using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Serialization;
using ICP_MS.Plugin.Tune.Properties;
using ZedGraph;

namespace ICP_MS.Plugin.Tune;

public class FormInstrumentCalibration : Form
{
	private FormInstrumentPA formPA = null;

	private const double a = 0.237;

	private const double q = 0.706;

	private const double pai = 3.1415926;

	private const double n = 2.0;

	private const double z = 1.0;

	private const double r0 = 0.005325;

	private const double sm = 1.66053873;

	private const double e = 1.0;

	private const double se = 1.602176462;

	private const double coe = 100000000.0;

	private bool IsRun = false;

	private System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();

	private AutoResetEvent scanEvent = new AutoResetEvent(initialState: false);

	private MassCalibration msc = new MassCalibration();

	private IContainer components = null;

	private TabControl tabControlCalibration;

	private TabPage pageMass;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn13;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn14;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn16;

	private GroupBox gbMass;

	private ZedGraphControl graphMass;

	private DataGridView dgvMass;

	private ToolStrip toolStrip2;

	private ToolStripButton tsbtnStartMass;

	private ToolStripButton tsbtnStopMass;

	private ToolStripSeparator toolStripSeparator3;

	private ToolStripSeparator toolStripSeparator2;

	private ToolStripButton tsbtnCreateMS;

	private ToolStripButton tsbtnAdd;

	private ToolStripButton tsbtnDelete;

	private ToolStripSeparator toolStripSeparator4;

	private ToolStripSeparator toolStripSeparator7;

	private ToolStripButton tsbtnExportMass;

	private ToolStripButton tsbtnImportMass;

	private DataGridViewImageColumn dataGridViewImageColumn1;

	private ToolStripSeparator toolStripSeparator9;

	private ToolStripButton tsbtnSelectAll;

	private ToolStripButton tsbtnDeselectAll;

	private ToolStripSeparator toolStripSeparator8;

	private ToolStripSeparator toolStripSeparator10;

	private ToolStripButton btnMassLog;

	private ToolStripButton btnFile;

	private TableLayoutPanel tableLayoutPanel1;

	private TabControl tabControl1;

	private TabPage tabPage1;

	private TabPage tabPage2;

	private ZedGraphControl graph;

	private GroupBox groupBox7;

	private System.Windows.Forms.Label lblCoef;

	private Button btnRefresh;

	private Button button1;

	private DataGridViewImageColumn colStatus;

	private DataGridViewTextBoxColumn colSymbol2;

	private DataGridViewTextBoxColumn colMass2;

	private DataGridViewTextBoxColumn colCenter2;

	private DataGridViewTextBoxColumn colError2;

	private DataGridViewTextBoxColumn colWidth2;

	private DataGridViewCheckBoxColumn colMassRun;

	private System.Windows.Forms.Label label1;

	private TextBox txtrdc;

	private System.Windows.Forms.Label label2;

	private TextBox txtrrf;

	private ToolStripButton tsbtnLink;

	private ToolStripButton tsbtnCheck;

	private ToolStripSeparator toolStripSeparator6;

	private ToolStripSeparator toolStripSeparator5;

	private ToolStripSeparator toolStripSeparator1;

	private TabPage pagePA;

	private TabPage PageDeadTime;

	private Button btndeadTime;

	private TextBox textBox1;

	private System.Windows.Forms.Label label5;

	private Button button2;

	private ComboBox comboBox1;

	private GroupBox groupBox1;

	private System.Windows.Forms.Label label3;

	private GroupBox groupBox2;

	private TabPage tabPage3;

	private Panel panel1;

	private GroupBox groupBox3;

	private TextBox textBox2;

	private System.Windows.Forms.Label label4;

	private Button button3;

	private GroupBox groupBox4;

	private Button button4;

	private Button button5;

	private System.Windows.Forms.Label label6;

	private System.Windows.Forms.Label label7;

	private NumericUpDown numericUpDown2;

	private NumericUpDown numericUpDown1;

	private ZedGraphControl graphAcq;

	private GroupBox groupBox5;

	private TabPage tabHexapole;

	private GroupBox gbHexapole;

	private DataGridView dgvHexapole;

	private CheckBox chkIsCalibration;

	private TableLayoutPanel tableLayoutPanel3;

	private TabControl tabControl3;

	private TabPage tabPage7;

	private GroupBox groupBox12;

	private GroupBox groupBox13;

	private System.Windows.Forms.Label label12;

	private System.Windows.Forms.Label label13;

	private TextBox textBox5;

	private System.Windows.Forms.Label label14;

	private TextBox textBox6;

	private GroupBox groupBox14;

	private ComboBox comboBox3;

	private System.Windows.Forms.Label label15;

	private Button button9;

	private ZedGraphControl graphHex;

	private ToolStrip toolStrip1;

	private ToolStripButton toolStripButton1;

	private ToolStripButton toolStripButton2;

	private ToolStripSeparator toolStripSeparator11;

	private ToolStripSeparator toolStripSeparator12;

	private ToolStripButton toolStripButton3;

	private ToolStripButton toolStripButton4;

	private ToolStripSeparator toolStripSeparator13;

	private ToolStripButton toolStripButton5;

	private ToolStripSeparator toolStripSeparator14;

	private ToolStripButton toolStripButton6;

	private ToolStripButton toolStripButton7;

	private ToolStripSeparator toolStripSeparator15;

	private ToolStripSeparator toolStripSeparator16;

	private ToolStripButton toolStripButton8;

	private ToolStripButton toolStripButton9;

	private ToolStripSeparator toolStripSeparator17;

	private ToolStripButton toolStripButton10;

	private ToolStripButton toolStripButton11;

	private ToolStripSeparator toolStripSeparator18;

	private ToolStripSeparator toolStripSeparator19;

	private Button button6;

	private ToolStripButton toolStripButton12;

	private DataGridViewImageColumn colStatus2;

	private DataGridViewTextBoxColumn ColElement;

	private DataGridViewTextBoxColumn ColMass;

	private DataGridViewTextBoxColumn ColCoefficient;

	private DataGridViewCheckBoxColumn ColCalibration;

	public FormInstrumentCalibration()
	{
		InitializeComponent();
	}

	private void FormInstrumentCalibration_Load(object sender, EventArgs e)
	{
		base.WindowState = FormWindowState.Maximized;
		InitMS();
		InitHexapole();
		if (formPA == null)
		{
			formPA = new FormInstrumentPA();
			formPA.TopLevel = false;
			formPA.Parent = pagePA;
			formPA.FormBorderStyle = FormBorderStyle.None;
			formPA.Dock = DockStyle.Fill;
			formPA.Show();
		}
		Detector.ExperimentStateChanged += Detector_ExperimentStateChanged;
		UserManager.UserChanged += UserManager_UserChanged;
		ApplyResources();
		PermissionManagement();
		textBox1.Text = $"{Detector.detectorConfig.DeadTime:00.0e0} ";
		graphAcq.GraphPane.Title.Text = Lang.Txt("ADDTune.Calibration.GraphTitle");
		graphAcq.GraphPane.XAxis.Title.Text = Lang.Txt("ADDTune.Calibration.GraphXTitle");
		graphAcq.GraphPane.YAxis.Title.Text = Lang.Txt("ADDTune.Calibration.GraphYTitle");
		graphAcq.GraphPane.AddCurve(Lang.Txt("ADDTune.Calibration.GraphYTitle"), new PointPairList(), Color.Red, SymbolType.None);
	}

	private void UserManager_UserChanged(object sender, EventArgs e)
	{
		PermissionManagement();
	}

	private void PermissionManagement()
	{
		if (UserManager.CurrentUser.authority <= 1)
		{
			tsbtnCreateMS.Visible = false;
			tabHexapole.Parent = null;
		}
		else
		{
			tabHexapole.Parent = tabControlCalibration;
			tsbtnCreateMS.Visible = true;
		}
	}

	private void Detector_ExperimentStateChanged(object sender, ExperimentStateArgs e)
	{
		if (e.State == 3)
		{
			EnableOperation(enable: true);
			msc.Stop();
		}
	}

	private void ApplyResources()
	{
		Text = Lang.Txt("FormInstrumentCalibration.Title.Text");
		pageMass.Text = Lang.Txt("FormInstrumentCalibration.pageMass.Text");
		tsbtnAdd.Text = Lang.Txt("FormInstrumentCalibration.Add.Text");
		tsbtnCreateMS.Text = Lang.Txt("FormInstrumentCalibration.Save.Text");
		tsbtnDelete.Text = Lang.Txt("FormInstrumentCalibration.Delete.Text");
		tsbtnDeselectAll.Text = Lang.Txt("FormInstrumentCalibration.Unselected.Text");
		tsbtnExportMass.Text = Lang.Txt("FormInstrumentCalibration.Export.Text");
		tsbtnImportMass.Text = Lang.Txt("FormInstrumentCalibration.Import.Text");
		tsbtnSelectAll.Text = Lang.Txt("FormInstrumentCalibration.AllSelected.Text");
		tsbtnStartMass.Text = Lang.Txt("FormInstrumentCalibration.Start.Text");
		tsbtnStopMass.Text = Lang.Txt("FormInstrumentCalibration.Stop.Text");
		colCenter2.HeaderText = Lang.Txt("FormInstrumentCalibration.Columns.Peak.Text");
		colError2.HeaderText = Lang.Txt("FormInstrumentCalibration.Columns.Error.Text");
		colMass2.HeaderText = Lang.Txt("FormInstrumentCalibration.Columns.Mass.Text");
		colMassRun.HeaderText = Lang.Txt("FormInstrumentCalibration.Columns.Calibration.Text");
		colSymbol2.HeaderText = Lang.Txt("FormInstrumentCalibration.Columns.Element.Text");
		colWidth2.HeaderText = Lang.Txt("FormInstrumentCalibration.Columns.Width.Text");
		tabPage1.Text = Lang.Txt("FormInstrumentCalibration.ScanCurves.Text");
		tabPage2.Text = Lang.Txt("FormInstrumentCalibration.PolyCurves.Text");
		groupBox7.Text = Lang.Txt("FormInstrumentCalibration.GroupBox.CurveParam.Text");
		btnRefresh.Text = Lang.Txt("FormInstrumentCalibration.Calculate.Text");
		button1.Text = Lang.Txt("FormInstrumentCalibration.CreateLookupTable.Text");
		label1.Text = Lang.Txt("FormInstrumentCalibration.RfDc.Rf.Text");
		label2.Text = Lang.Txt("FormInstrumentCalibration.RfDc.Dc.Text");
		tsbtnLink.ToolTipText = Lang.Txt("ADDTune.Calibration.Link");
		tsbtnCheck.ToolTipText = Lang.Txt("ADDTune.Calibration.Check");
		tabControlCalibration.TabPages[1].Text = Lang.Txt("ADDTune.Calibration.VoltagePlatforms.Text");
		tabControlCalibration.TabPages[2].Text = Lang.Txt("ADDTune.Calibration.DeadTimeCorrection.Text");
		tabControlCalibration.TabPages[3].Text = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.Text");
		comboBox1.Items[0] = Lang.Txt("ADDTune.Calibration.PrimaryFit");
		comboBox1.Items[1] = Lang.Txt("ADDTune.Calibration.QuadraticFit");
		label3.Text = Lang.Txt("ADDTune.Calibration.FittingMethod");
		groupBox3.Text = Lang.Txt("ADDTune.Calibration.VoltagePlatforms.VoltageSetting");
		groupBox4.Text = Lang.Txt("ADDTune.Calibration.VoltagePlatforms.Find");
		groupBox5.Text = Lang.Txt("ADDTune.Calibration.VoltagePlatforms.Set");
		label6.Text = Lang.Txt("ADDTune.Calibration.VoltagePlatforms.VoltageDifference");
		button5.Text = Lang.Txt("ADDTune.Calibration.VoltagePlatforms.Find");
		button4.Text = Lang.Txt("ADDTune.Calibration.VoltagePlatforms.Stop");
		label4.Text = Lang.Txt("ADDTune.Calibration.VoltagePlatforms.RecommendedHVP");
		button3.Text = Lang.Txt("ADDTune.Calibration.VoltagePlatforms.Set");
		label5.Text = Lang.Txt("ADDTune.Calibration.DeadTimeCorrection.DeadTime");
		btndeadTime.Text = Lang.Txt("ADDTune.Calibration.DeadTimeCorrection.Text");
		button2.Text = Lang.Txt("ADDTune.Calibration.DeadTimeCorrection.SetTo");
		tabHexapole.Text = Lang.Txt("FormInstrumentCalibration.tabHexapole.Text");
		chkIsCalibration.Text = Lang.Txt("FormInstrumentCalibration.IsorNotCorrection.Text");
		label15.Text = Lang.Txt("ADDTune.Calibration.FittingMethod");
		button6.Text = Lang.Txt("FormInstrumentCalibration.CreateLookupTable.Text");
		groupBox12.Text = Lang.Txt("FormInstrumentCalibration.GroupBox.CurveParam.Text");
		tabPage7.Text = Lang.Txt("FormInstrumentCalibration.PolyCurves.Text");
		comboBox3.Items[0] = Lang.Txt("ADDTune.Calibration.SegmentalFit");
		comboBox3.Items[1] = Lang.Txt("ADDTune.Calibration.InterpolationFit");
		button9.Text = Lang.Txt("FormInstrumentCalibration.Calculate.Text");
		ColElement.HeaderText = Lang.Txt("FormInstrumentCalibration.Columns.Element.Text");
		ColMass.HeaderText = Lang.Txt("FormInstrumentCalibration.Columns.Mass.Text");
		ColCoefficient.HeaderText = Lang.Txt("FormInstrumentCalibration.Columns.HexCoefficient.Text");
		ColCalibration.HeaderText = Lang.Txt("FormInstrumentCalibration.Columns.Calibration.Text");
	}

	private void FormInstrumentCalibration_FormClosing(object sender, FormClosingEventArgs e)
	{
		DisposeMS();
		if (formPA != null)
		{
			formPA.Dispose();
		}
		Detector.ExperimentStateChanged -= Detector_ExperimentStateChanged;
		UserManager.UserChanged -= UserManager_UserChanged;
	}

	public void StopRun()
	{
	}

	private bool InitMS()
	{
		graphMass.GraphPane.Title.Text = "";
		graphMass.GraphPane.XAxis.Title.Text = Lang.Txt("FormInstrumentCalibration.graphMass.XTitle.Text");
		graphMass.GraphPane.YAxis.Title.Text = Lang.Txt("FormInstrumentCalibration.graphMass.YTitle.Text");
		graphMass.GraphPane.Y2Axis.Title.Text = Lang.Txt("FormInstrumentCalibration.graphMass.Y2Title.Text");
		msc.Init();
		msc.RefreshFactors += MS_RefreshFactors;
		msc.RefreshSpectrums += MS_RefreshSpectrums;
		msc.CalibrationFinish += MS_CalibrationFinish;
		RebindDatas();
		return false;
	}

	private bool InitHexapole()
	{
		graphHex.GraphPane.Title.Text = Lang.Txt("FormInstrumentCalibration.graphHexTitle.Text");
		graphHex.GraphPane.XAxis.Title.Text = Lang.Txt("FormInstrumentCalibration.Curve.X.Title.Text");
		graphHex.GraphPane.YAxis.Title.Text = Lang.Txt("FormInstrumentCalibration.Curve.Y.Title.Text");
		msc.Init2();
		RebindHexapoleDatas();
		InitHex();
		return false;
	}

	public void InitHex()
	{
		if (msc.MassHexapole.Count > 0)
		{
			chkIsCalibration.Checked = msc.MassHexapole[0].hexcalibration;
			Detector.Instance.IsHexCalibration(chkIsCalibration.Checked);
		}
	}

	private void RebindHexapoleDatas()
	{
		msc.MassHexapole.Sort((MassHexapole s1, MassHexapole s2) => s1.mass.CompareTo(s2.mass));
		dgvHexapole.AutoGenerateColumns = false;
		if (dgvHexapole.DataSource == null)
		{
			dgvHexapole.DataSource = msc.MassHexapole;
			return;
		}
		BindingContext[dgvHexapole.DataSource].SuspendBinding();
		dgvHexapole.DataSource = null;
		dgvHexapole.DataSource = msc.MassHexapole;
		BindingContext[dgvHexapole.DataSource].ResumeBinding();
	}

	private bool DisposeMS()
	{
		msc.RefreshFactors -= MS_RefreshFactors;
		msc.RefreshSpectrums -= MS_RefreshSpectrums;
		msc.CalibrationFinish -= MS_CalibrationFinish;
		msc.Dispose();
		return false;
	}

	private void MS_RefreshFactors(object sender, EventArgs e)
	{
		Invoke((MethodInvoker)delegate
		{
			dgvMass.Refresh();
		});
	}

	private void MS_RefreshSpectrums(object sender, EventArgs e)
	{
		Invoke((MethodInvoker)delegate
		{
			try
			{
				GraphPane graphPane = graphMass.GraphPane;
				graphPane.CurveList.Clear();
				graphPane.AddCurve(Lang.Txt("FormInstrumentCalibration.Orgin.Text"), msc.CurrentSpectums[0].Mass, msc.CurrentSpectums[0].Intensity, Color.Blue, SymbolType.None);
				graphPane.AddCurve(Lang.Txt("FormInstrumentCalibration.Filt.Text"), msc.CurrentSpectums[1].Mass, msc.CurrentSpectums[1].Intensity, Color.Red, SymbolType.None);
				graphPane.AxisChange();
				graphMass.Refresh();
			}
			catch
			{
			}
		});
	}

	private void MS_CalibrationFinish(object sender, EventArgs e)
	{
		EnableOperation(enable: true);
		Invoke((MethodInvoker)delegate
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.CalibrationFinished.Text"));
		});
		Detector.Instance.ExperimentState = -1;
	}

	private void RebindDatas()
	{
		msc.MassFactors.Sort((MassFactor s1, MassFactor s2) => s1.mass.CompareTo(s2.mass));
		dgvMass.AutoGenerateColumns = false;
		if (dgvMass.DataSource == null)
		{
			dgvMass.DataSource = msc.MassFactors;
		}
		else
		{
			BindingContext[dgvMass.DataSource].SuspendBinding();
			dgvMass.DataSource = null;
			dgvMass.DataSource = msc.MassFactors;
			BindingContext[dgvMass.DataSource].ResumeBinding();
		}
		dgvMass.DataSource = msc.MassFactors;
	}

	private void tsbtnStartMass_Click(object sender, EventArgs e)
	{
		if (Detector.Instance.ExperimentState != -1)
		{
			if (Detector.Instance.ExperimentState == 3)
			{
				MessageBox.Show(Lang.Txt("Tune.TipsText1"), Lang.Txt("AddFormIgnite.Warn"));
				return;
			}
			if (MessageBox.Show(Lang.Txt("Tune.TipsText2"), Lang.Txt("AddFormIgnite.Warn"), MessageBoxButtons.YesNo) != DialogResult.Yes)
			{
				return;
			}
			Detector.Instance.ExperimentStateChange(Detector.Instance.ExperimentState);
		}
		FormResolution formResolution = new FormResolution();
		if (formResolution.ShowDialog() == DialogResult.OK)
		{
			msc.CurrentResolution = formResolution.Resolution;
			EnableOperation(enable: false);
			msc.Start();
		}
	}

	private void tsbtnStopMass_Click(object sender, EventArgs e)
	{
		EnableOperation(enable: true);
		msc.Stop();
	}

	private void EnableOperation(bool enable)
	{
		Invoke((MethodInvoker)delegate
		{
			tsbtnAdd.Enabled = enable;
			tsbtnDelete.Enabled = enable;
			tsbtnStartMass.Enabled = enable;
		});
	}

	private void dgvMass_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
	{
		if (e.Button == MouseButtons.Left && e.RowIndex >= 0 && e.ColumnIndex == colSymbol2.Index)
		{
			MassFactor factor = msc.MassFactors[e.RowIndex];
			FormMassSelect formMassSelect = new FormMassSelect(DataBase.Instance, factor.symbol);
			if (formMassSelect.ShowDialog() == DialogResult.OK)
			{
				factor.isotopeId = formMassSelect.SelectedIsotope.id;
				factor.symbol = formMassSelect.SelectedIsotope.symbol;
				factor.mass = formMassSelect.SelectedIsotope.mass;
				factor.bDC = (float)CalculateDC(factor.mass, QuadMonitor.quad.ReadFreq);
				factor.bRF = (float)CalculateRF(factor.mass, QuadMonitor.quad.ReadFreq);
				factor.kDC = 0.0;
				factor.kRF = 0.0;
				factor.start = factor.mass - 2.0;
				factor.end = factor.mass + 2.0;
				dgvMass.Refresh();
			}
		}
	}

	private void dgvMass_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
	{
		if (e.Button == MouseButtons.Right && e.RowIndex >= 0)
		{
			ContextMenu menu = new ContextMenu();
			menu.MenuItems.Add(Lang.Txt("FormInstrumentCalibration.Menu.ModifyCoef.Text"), delegate
			{
				FormMassFactor formMassFactor = new FormMassFactor(msc.MassFactors[e.RowIndex]);
				formMassFactor.ShowDialog();
			});
			Rectangle rect = dgvMass.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, cutOverflow: false);
			Point pt = e.Location;
			pt.Offset(rect.X, rect.Y);
			menu.Show(dgvMass, pt);
		}
	}

	private void dgvMass_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
	{
	}

	private void dgvMass_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex == colStatus.Index)
		{
			switch ((int)e.Value)
			{
			case 0:
				e.Value = Resources.PROCESS_READY;
				break;
			case 1:
				e.Value = Resources.PROCESS_PROCESSING;
				break;
			case 2:
				e.Value = Resources.PROCESS_RIGHT;
				break;
			case 3:
			case 4:
				e.Value = Resources.PROCESS_WRONG;
				break;
			}
			e.FormattingApplied = true;
		}
		else if (e.ColumnIndex == colCenter2.Index || e.ColumnIndex == colError2.Index || e.ColumnIndex == colWidth2.Index)
		{
			e.Value = $"{e.Value:0.0000}";
		}
	}

	private void tsbtnSave_Click(object sender, EventArgs e)
	{
		if (msc.MassFactors == null || msc.MassFactors.Count == 0)
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.NoElement.Text"));
			return;
		}
		msc.Save();
		string msFile = Detector.Instance.msDacPath;
		switch (msc.CurrentResolution.ResolutionType)
		{
		case 0:
			msFile = Detector.Instance.msDacHighPath;
			break;
		case 1:
			msFile = Detector.Instance.msDacPath;
			break;
		case 2:
			msFile = Detector.Instance.msDacLowPath;
			break;
		}
		if (msc.CreateLookupTable(msFile))
		{
			Detector.Instance.LoadLookupTableMS(msc.CurrentResolution.ResolutionType, msFile);
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.CreateTSuccess.Text"));
		}
		else
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.CreateTFailure.Text"));
		}
	}

	private void tsbtnAdd_Click(object sender, EventArgs e)
	{
		FormMassSelect formMassSelect = new FormMassSelect(DataBase.Instance);
		if (formMassSelect.ShowDialog() == DialogResult.OK)
		{
			MassFactor factor = new MassFactor();
			factor.kDC = 1.0;
			factor.kRF = 1.0;
			factor.isotopeId = formMassSelect.SelectedIsotope.id;
			factor.symbol = formMassSelect.SelectedIsotope.symbol;
			factor.mass = formMassSelect.SelectedIsotope.mass;
			factor.start = factor.mass - 1.0;
			factor.end = factor.mass + 1.0;
			msc.MassFactors.Add(factor);
			RebindDatas();
		}
	}

	private void tsbtnDelete_Click(object sender, EventArgs e)
	{
		List<string> selectSyms = new List<string>();
		foreach (DataGridViewCell cell in dgvMass.SelectedCells)
		{
			selectSyms.Add(msc.MassFactors[cell.RowIndex].symbol);
		}
		msc.MassFactors.RemoveAll((MassFactor factor) => selectSyms.Contains(factor.symbol));
		RebindDatas();
	}

	private void tsbtnExportMass_Click(object sender, EventArgs e)
	{
		SaveFileDialog dlg = new SaveFileDialog();
		dlg.Filter = "Xml files(*.xml)|*.xml";
		dlg.FileName = DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss") + ".xml";
		if (dlg.ShowDialog() == DialogResult.OK)
		{
			using (FileStream fs = new FileStream(dlg.FileName, FileMode.Create, FileAccess.Write))
			{
				XmlSerializer serializer = new XmlSerializer(typeof(List<MassFactor>));
				serializer.Serialize(fs, msc.MassFactors);
			}
		}
	}

	private void tsbtnImportMass_Click(object sender, EventArgs e)
	{
		OpenFileDialog dlg = new OpenFileDialog();
		dlg.Filter = "Xml files(*.xml)|*.xml";
		if (dlg.ShowDialog() != DialogResult.OK)
		{
			return;
		}
		using FileStream fs = new FileStream(dlg.FileName, FileMode.Open, FileAccess.Read);
		try
		{
			XmlSerializer serializer = new XmlSerializer(typeof(List<MassFactor>));
			if (serializer.Deserialize(fs) is List<MassFactor> tmp)
			{
				msc.MassFactors.Clear();
				msc.MassFactors.AddRange(tmp.ToArray());
				RebindDatas();
			}
		}
		catch
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.FileNotOK.Text"));
		}
	}

	private void dgvMass_CurrentCellDirtyStateChanged(object sender, EventArgs e)
	{
		if (dgvMass.IsCurrentCellDirty)
		{
			dgvMass.CommitEdit(DataGridViewDataErrorContexts.Commit);
		}
	}

	private void tsbtnSelectAll_Click(object sender, EventArgs e)
	{
		msc.SelectAll(select: true);
		dgvMass.Refresh();
	}

	private void tsbtnDeselectAll_Click(object sender, EventArgs e)
	{
		msc.SelectAll(select: false);
		dgvMass.Refresh();
	}

	private void btnMassLog_Click(object sender, EventArgs e)
	{
		try
		{
			string logPath = Application.StartupPath + "\\iMassConfig\\msca.txt";
			if (File.Exists(logPath))
			{
				File.Delete(logPath);
			}
			using (StreamWriter sw = new StreamWriter(logPath))
			{
				sw.Write(msc.LogTxt);
			}
			Process.Start(logPath);
		}
		catch
		{
		}
	}

	private void btnFile_Click(object sender, EventArgs e)
	{
		SaveFileDialog dlg = new SaveFileDialog();
		dlg.Filter = "csv file(*.csv)|*.csv";
		if (dlg.ShowDialog() == DialogResult.OK)
		{
			msc.SaveCsv(dlg.FileName);
		}
	}

	public bool CreateTable(string path)
	{
		Task.Factory.StartNew(delegate
		{
			try
			{
				string tempFileName = Path.GetTempFileName();
				using (FileStream output = new FileStream(tempFileName, FileMode.Create, FileAccess.Write))
				{
					using BinaryWriter binaryWriter = new BinaryWriter(output);
					double dck = RFManager.massQP.dck0;
					double dcb = RFManager.massQP.dcb0;
					double rfk = RFManager.massQP.rfk0;
					double rfb = RFManager.massQP.rfb0;
					List<double> list = new List<double>();
					List<double> list2 = new List<double>();
					List<double> list3 = new List<double>();
					for (int i = 0; i < msc.MassFactors.Count; i++)
					{
						if (msc.MassFactors[i].run)
						{
							list.Add(msc.MassFactors[i].kRF * rfk + rfb);
							list2.Add(msc.MassFactors[i].kDC * dck + dcb);
							list3.Add(msc.MassFactors[i].mass);
						}
					}
					double[] array = LSFit.LineFit(list3.ToArray(), list.ToArray(), 0.0, 0.0, false);
					double[] array2 = LSFit.LineFit(list3.ToArray(), list2.ToArray(), 0.0, 0.0, false);
					if (array != null && array2 != null)
					{
						double num = 0.0;
						double num2 = 0.0;
						double num3 = 0.0;
						for (; num <= 260.0; num += 0.01)
						{
							num2 = array[0] * num + array[1];
							num3 = array2[0] * num + array2[1];
							if (num2 < 0.0)
							{
								num2 = 0.0;
							}
							if (num2 > 65535.0)
							{
								num2 = 65535.0;
							}
							ushort value = (ushort)num2;
							if (num3 < 0.0)
							{
								num3 = 0.0;
							}
							if (num3 > 65535.0)
							{
								num2 = 65535.0;
							}
							ushort value2 = (ushort)num3;
							binaryWriter.Write(value);
							binaryWriter.Write(value2);
						}
					}
				}
				if (File.Exists(path))
				{
					File.Delete(path);
				}
				File.Copy(tempFileName, path);
				File.Delete(tempFileName);
				return true;
			}
			catch (Exception ex)
			{
				Log.InsertLog(Lang.Txt("FormInstrumentCalibration.Log.Category.Calibration.Text"), Lang.Txt("FormInstrumentCalibration.Log.CreateTableFail.Text"), ex.Message, (Severity)3);
			}
			return false;
		});
		return true;
	}

	private double CalculateDC(double mass, double f)
	{
		return mass * 1.66053873 / 160217646.20000002 * (0.237 * (6.2831852 * f) * (6.2831852 * f) * 0.005325 * 0.005325 / 8.0);
	}

	private double CalculateRF(double mass, double f)
	{
		return mass * 1.66053873 / 160217646.20000002 * (0.706 * (6.2831852 * f) * (6.2831852 * f) * 0.005325 * 0.005325 / 4.0);
	}

	public double CalculateCoeDC(double U, double f)
	{
		double buf = 1.0364268664433792E-08 * (0.237 * (6.2831852 * f) * (6.2831852 * f) * 0.005325 * 0.005325 / 8.0);
		return U / buf;
	}

	public double CalculateCoeRF(double V, double f)
	{
		double buf = 1.0364268664433792E-08 * (0.706 * (6.2831852 * f) * (6.2831852 * f) * 0.005325 * 0.005325 / 4.0);
		return V / buf;
	}

	private void DrawCurves(int order)
	{
		graph.GraphPane.Title.Text = Lang.Txt("FormInstrumentCalibration.Curve.Title.Text");
		graph.GraphPane.XAxis.Title.Text = Lang.Txt("FormInstrumentCalibration.Curve.X.Title.Text");
		graph.GraphPane.YAxis.Title.Text = Lang.Txt("FormInstrumentCalibration.Curve.Y.Title.Text");
		double kdc0 = RFManager.massQP.dck0;
		double bdc0 = RFManager.massQP.dcb0;
		double krf0 = RFManager.massQP.rfk0;
		double brf0 = RFManager.massQP.rfb0;
		List<double> rfList = new List<double>();
		List<double> dcList = new List<double>();
		List<double> massList = new List<double>();
		for (int j = 0; j < msc.MassFactors.Count; j++)
		{
			if (msc.MassFactors[j].run)
			{
				rfList.Add(krf0 * (CalculateRF(msc.MassFactors[j].mass, QuadMonitor.quad.ReadFreq) + msc.MassFactors[j].kRF) * 2.0 + brf0);
				dcList.Add(kdc0 * (CalculateDC(msc.MassFactors[j].mass, QuadMonitor.quad.ReadFreq) + msc.MassFactors[j].kDC) + bdc0);
				massList.Add(msc.MassFactors[j].mass);
			}
		}
		List<double> rfFitList = new List<double>();
		List<double> dcFitList = new List<double>();
		double rfR = 0.0;
		double dcR = 0.0;
		double[] kbrf;
		double[] kbdc;
		if (order == 1)
		{
			kbrf = LSFit.LineFit(massList.ToArray(), rfList.ToArray(), 0.0, 0.0, false);
			kbdc = LSFit.LineFit(massList.ToArray(), dcList.ToArray(), 0.0, 0.0, false);
		}
		else
		{
			kbrf = LSFit.Polynomial(massList.ToArray(), rfList.ToArray(), 2);
			kbdc = LSFit.Polynomial(massList.ToArray(), dcList.ToArray(), 2);
			for (int i = 0; i < massList.Count; i++)
			{
				rfFitList.Add(kbrf[2] * massList[i] * massList[i] + kbrf[1] * massList[i] + kbrf[0]);
				dcFitList.Add(kbdc[2] * massList[i] * massList[i] + kbdc[1] * massList[i] + kbdc[0]);
			}
			rfR = LSFit.Pearson((IEnumerable<double>)rfFitList, (IEnumerable<double>)rfList);
			dcR = LSFit.Pearson((IEnumerable<double>)dcFitList, (IEnumerable<double>)rfList);
		}
		LineItem line0 = graph.GraphPane.AddCurve(Lang.Txt("FormInstrumentCalibration.LinearRf.Text"), massList.ToArray(), rfList.ToArray(), Color.Red, SymbolType.Circle);
		if (order == 1)
		{
			line0.Line.IsVisible = true;
		}
		else
		{
			line0.Line.IsVisible = false;
		}
		line0.Symbol.Fill.Type = FillType.Solid;
		LineItem line1 = graph.GraphPane.AddCurve(Lang.Txt("FormInstrumentCalibration.LinearDC.Text"), massList.ToArray(), dcList.ToArray(), Color.Blue, SymbolType.Diamond);
		if (order == 1)
		{
			line1.Line.IsVisible = true;
		}
		else
		{
			line1.Line.IsVisible = false;
		}
		line1.Symbol.Fill.Type = FillType.Solid;
		if (order == 2)
		{
			LineItem line2 = graph.GraphPane.AddCurve(Lang.Txt("FormInstrumentCalibration.QuadraticRF.Text"), massList.ToArray(), rfFitList.ToArray(), Color.Red, SymbolType.Circle);
			line2.Line.IsVisible = true;
			line2.Symbol.IsVisible = false;
			LineItem line3 = graph.GraphPane.AddCurve(Lang.Txt("FormInstrumentCalibration.QuadraticDC.Text"), massList.ToArray(), dcFitList.ToArray(), Color.Blue, SymbolType.Diamond);
			line3.Line.IsVisible = true;
			line3.Symbol.IsVisible = false;
		}
		Invoke((EventHandler)delegate
		{
			txtrrf.Text = ((order == 1) ? kbrf[2].ToString("F5") : rfR.ToString("F5"));
			txtrdc.Text = ((order == 1) ? kbdc[2].ToString("F5") : dcR.ToString("F5"));
		});
		graph.GraphPane.AxisChange();
		graph.Refresh();
	}

	private void btnRefresh_Click(object sender, EventArgs e)
	{
		int count = 0;
		for (int i = 0; i < msc.MassFactors.Count; i++)
		{
			if (msc.MassFactors[i].run)
			{
				count++;
			}
		}
		if (count < 2)
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.TipsText1.Text"));
		}
		graph.GraphPane.CurveList.Clear();
		int order = ((comboBox1.Text == Lang.Txt("FormInstrumentCalibration.FirstFit.Text")) ? 1 : 2);
		DrawCurves(order);
	}

	public void DrawChazhi()
	{
		double kdc0 = RFManager.massQP.dck0;
		double bdc0 = RFManager.massQP.dcb0;
		double krf0 = RFManager.massQP.rfk0;
		double brf0 = RFManager.massQP.rfb0;
		double kdc1 = RFManager.massQP.dck1;
		double bdc1 = RFManager.massQP.dcb1;
		double krf1 = RFManager.massQP.rfk1;
		double brf1 = RFManager.massQP.rfb1;
		List<double> rfList = new List<double>();
		List<double> dcList = new List<double>();
		List<double> massList = new List<double>();
		double i = 0.0;
		double valueRf = 0.0;
		double valueDc = 0.0;
		for (; i <= 260.0; i += 0.01)
		{
			MassFactor factor = msc.GetNearestFactor(i);
			kdc1 = factor.kDC;
			bdc1 = factor.bDC;
			krf1 = factor.kRF;
			brf1 = factor.bRF;
			valueRf = factor.kRF * 2.0 * krf0 + brf0;
			valueDc = factor.kDC * kdc0 + bdc0;
			if (valueRf < 0.0)
			{
				valueRf = 0.0;
			}
			if (valueRf > 65535.0)
			{
				valueRf = 65535.0;
			}
			ushort dacRf = (ushort)valueRf;
			if (valueDc < 0.0)
			{
				valueDc = 0.0;
			}
			if (valueDc > 65535.0)
			{
				valueRf = 65535.0;
			}
			ushort dacDc = (ushort)valueDc;
			rfList.Add((int)dacRf);
			dcList.Add((int)dacDc);
			massList.Add(i);
		}
		double[] kbrf = LSFit.LineFit(massList.ToArray(), rfList.ToArray(), 0.0, 0.0, false);
		double[] kbdc = LSFit.LineFit(massList.ToArray(), dcList.ToArray(), 0.0, 0.0, false);
		LineItem line0 = graph.GraphPane.AddCurve("chazhi-rf", massList.ToArray(), rfList.ToArray(), Color.Gold, SymbolType.Circle);
		line0.Line.IsVisible = true;
		line0.Symbol.Fill.Type = FillType.Solid;
		LineItem line1 = graph.GraphPane.AddCurve("chazhi-dc", massList.ToArray(), dcList.ToArray(), Color.Green, SymbolType.Diamond);
		line1.Line.IsVisible = true;
		line1.Symbol.Fill.Type = FillType.Solid;
		Invoke((EventHandler)delegate
		{
			txtrrf.Text = kbrf[2].ToString("F5");
			txtrdc.Text = kbdc[2].ToString("F5");
			graph.GraphPane.AxisChange();
			graph.Refresh();
		});
	}

	private void button1_Click(object sender, EventArgs e)
	{
		if (msc.MassFactors == null || msc.MassFactors.Count == 0)
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.NoElement.Text"));
			return;
		}
		msc.Save();
		string msFile = Detector.Instance.msDacPath;
		switch (msc.CurrentResolution.ResolutionType)
		{
		case 0:
			msFile = Detector.Instance.msDacHighPath;
			break;
		case 1:
			msFile = Detector.Instance.msDacPath;
			break;
		case 2:
			msFile = Detector.Instance.msDacLowPath;
			break;
		}
		int order = ((comboBox1.Text == Lang.Txt("FormInstrumentCalibration.FirstFit.Text")) ? 1 : 2);
		if (msc.CreateTable(msFile, order))
		{
			Detector.Instance.LoadLookupTableMS(msc.CurrentResolution.ResolutionType, msFile);
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.CreateTSuccess.Text"));
		}
		else
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.CreateTFailure.Text"));
		}
	}

	private void tsbtnLink_Click(object sender, EventArgs e)
	{
		if (MessageBox.Show(Lang.Txt("FormInstrumentCalibration.TipsText2.Text"), Lang.Txt("AddFormIgnite.Warn"), MessageBoxButtons.YesNo) == DialogResult.No)
		{
			return;
		}
		try
		{
			if (FormInstrumentTune.massDatas != null && FormInstrumentTune.massDatas.Count > 0 && msc.MassFactors.Count > 0)
			{
				foreach (MassData massData in FormInstrumentTune.massDatas)
				{
					int index = msc.MassFactors.FindIndex((MassFactor r) => r.symbol == massData.symbol);
					if (index >= 0)
					{
						msc.MassFactors[index].kRF = massData.kRF;
						msc.MassFactors[index].bRF = massData.bRF;
						msc.MassFactors[index].kDC = massData.kDC;
						msc.MassFactors[index].bDC = massData.bDC;
					}
				}
			}
		}
		catch (Exception ex)
		{
			MessageBox.Show(ex.Message);
		}
		MessageBox.Show(Lang.Txt("FormInstrumentCalibration.TipsText3.Text"), Lang.Txt("AddFormIgnite.Warn"));
	}

	private void tsbtnCheck_Click(object sender, EventArgs e)
	{
		if (Detector.Instance.ExperimentState != -1)
		{
			if (Detector.Instance.ExperimentState == 3)
			{
				MessageBox.Show(Lang.Txt("Tune.TipsText1"), Lang.Txt("AddFormIgnite.Warn"));
				return;
			}
			if (MessageBox.Show(Lang.Txt("Tune.TipsText2"), Lang.Txt("AddFormIgnite.Warn"), MessageBoxButtons.YesNo) != DialogResult.Yes)
			{
				return;
			}
			Detector.Instance.ExperimentStateChange(Detector.Instance.ExperimentState);
		}
		EnableOperation(enable: false);
		msc.StartCheck();
	}

	private void btndeadTime_Click(object sender, EventArgs e)
	{
		if (Detector.Instance.ExperimentState != -1)
		{
			if (Detector.Instance.ExperimentState == 4)
			{
				MessageBox.Show(Lang.Txt("Tune.TipsText1"), Lang.Txt("AddFormIgnite.Warn"));
				return;
			}
			if (MessageBox.Show(Lang.Txt("Tune.TipsText2"), Lang.Txt("AddFormIgnite.Warn"), MessageBoxButtons.YesNo) != DialogResult.Yes)
			{
				return;
			}
			Detector.Instance.ExperimentStateChange(Detector.Instance.ExperimentState);
		}
		if (MessageBox.Show(Lang.Txt("FormInstrumentCalibration.TipsText4.Text"), Lang.Txt("AddFormIgnite.Warn"), MessageBoxButtons.YesNo) == DialogResult.Yes)
		{
			Detector.detectorConfig.DeadTime = 0.0;
			FormInstrumentDeadTime formDeadTime = new FormInstrumentDeadTime();
			if (formDeadTime.ShowDialog() == DialogResult.OK)
			{
				Detector.detectorConfig.DeadTime = formDeadTime.experiment.tao;
			}
			textBox1.Text = $"{Detector.detectorConfig.DeadTime:00.0e0}";
		}
	}

	private void button2_Click(object sender, EventArgs e)
	{
		Detector.detectorConfig.DeadTime = 0.0;
		textBox1.Text = Detector.detectorConfig.DeadTime.ToString();
	}

	private void button5_Click(object sender, EventArgs e)
	{
		Task.Factory.StartNew(delegate
		{
			Invoke((MethodInvoker)delegate
			{
				graphAcq.GraphPane.CurveList[0].Clear();
			});
			int num = (int)RFManager.rfs.ReadHVN;
			if (Detector.detectorConfig.IsNewDetector)
			{
				Detector.Instance.msDetectorRF.SetHVNNew();
			}
			else
			{
				Detector.Instance.msDetectorRF.SetHVN();
			}
			int minHV2 = (int)numericUpDown1.Value + num;
			int maxHV2 = (int)numericUpDown2.Value + num;
			Invoke((MethodInvoker)delegate
			{
				graphAcq.GraphPane.XAxis.Scale.Min = minHV2;
				graphAcq.GraphPane.YAxis.Scale.Max = maxHV2;
			});
			int num2 = 100;
			IsRun = true;
			scanEvent.Reset();
			Detector.pulseReceive += Detector_pulseReceive;
			Detector.finishReceive += Detector_finishReceive;
			for (int i = minHV2; i < maxHV2; i += num2)
			{
				RFManager.rfs.HVP = i;
				if (Detector.detectorConfig.IsNewDetector)
				{
					Detector.Instance.msDetectorRF.SetHVPNew();
					RFManager.rfs.Gate = (float)((double)RFManager.rfs.HVP * 0.23);
					Detector.Instance.msDetectorRF.SetGateNew();
					Thread.Sleep(2000);
				}
				else
				{
					Detector.Instance.msDetectorRF.SetHVP();
					RFManager.rfs.Gate = (float)((double)RFManager.rfs.HVP * 0.23);
					Detector.Instance.msDetectorRF.SetGate();
					Thread.Sleep(2000);
				}
				double[] array = new double[1] { 114.90387 };
				Detector.Instance.SetMassAxis(array);
				Detector.Instance.SendHopDatas(array, new int[1] { 1 }, true, false);
				if (!scanEvent.WaitOne(60000))
				{
					Log.InsertLog(Lang.Txt("FormExperLog.Text4"), Lang.Txt("FormExperLog.Text2"), Lang.Txt("FormExperLog.Text3"), (Severity)3);
					scanEvent.Reset();
					break;
				}
				if (!IsRun)
				{
					break;
				}
			}
			RFManager.rfs.HVP = minHV2;
			if (Detector.detectorConfig.IsNewDetector)
			{
				Detector.Instance.msDetectorRF.SetHVPNew();
			}
			else
			{
				Detector.Instance.msDetectorRF.SetHVP();
			}
			Detector.pulseReceive -= Detector_pulseReceive;
			Detector.finishReceive -= Detector_finishReceive;
		});
	}

	private void button4_Click(object sender, EventArgs e)
	{
		IsRun = false;
		scanEvent.Set();
	}

	private void Detector_pulseReceive(object sender, PointEventArgs e)
	{
		double x = RFManager.rfs.HVP;
		double y = e.Y;
		graphAcq.GraphPane.CurveList[0].AddPoint(x, y);
		Invoke((MethodInvoker)delegate
		{
			graphAcq.AxisChange();
			graphAcq.Refresh();
		});
	}

	private void Detector_finishReceive(object sender, EventArgs e)
	{
		scanEvent.Set();
	}

	private void button3_Click(object sender, EventArgs e)
	{
		try
		{
			int HVP = Convert.ToInt32(textBox1.Text);
			RFManager.rfs.HVP = HVP;
			RFManager.rfs.Gate = (float)((double)RFManager.rfs.HVP * 0.23);
			if (Detector.detectorConfig.IsNewDetector)
			{
				Detector.Instance.msDetectorRF.SetHVPNew();
				Detector.Instance.msDetectorRF.SetGateNew();
			}
			else
			{
				Detector.Instance.msDetectorRF.SetHVP();
				Detector.Instance.msDetectorRF.SetGate();
			}
		}
		catch (Exception ex)
		{
			MessageBox.Show(ex.Message);
		}
	}

	private void toolStripButton3_Click(object sender, EventArgs e)
	{
		FormMassSelect formMassSelect = new FormMassSelect(DataBase.Instance);
		if (formMassSelect.ShowDialog() == DialogResult.OK)
		{
			MassHexapole factor = new MassHexapole();
			factor.isotopeId = formMassSelect.SelectedIsotope.id;
			factor.symbol = formMassSelect.SelectedIsotope.symbol;
			factor.mass = formMassSelect.SelectedIsotope.mass;
			msc.MassHexapole.Add(factor);
			RebindHexapoleDatas();
		}
	}

	private void toolStripButton4_Click(object sender, EventArgs e)
	{
		List<string> selectSyms = new List<string>();
		foreach (DataGridViewCell cell in dgvHexapole.SelectedCells)
		{
			selectSyms.Add(msc.MassHexapole[cell.RowIndex].symbol);
		}
		msc.MassHexapole.RemoveAll((MassHexapole factor) => selectSyms.Contains(factor.symbol));
		RebindHexapoleDatas();
	}

	private void toolStripButton8_Click(object sender, EventArgs e)
	{
		for (int i = 0; i < msc.MassHexapole.Count; i++)
		{
			msc.MassHexapole[i].run = true;
		}
		RebindHexapoleDatas();
	}

	private void button9_Click(object sender, EventArgs e)
	{
		if (msc.MassHexapole == null || msc.MassHexapole.Count == 0)
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.NoElement.Text"));
			return;
		}
		graphHex.GraphPane.CurveList.Clear();
		int order = 1;
		DrawCurves1(order);
		msc.Save2();
	}

	private void DrawCurves1(int order)
	{
		if (msc.MassHexapole.Count < 4)
		{
			return;
		}
		List<double> HexList = new List<double>();
		List<double> massList = new List<double>();
		for (int i = 0; i < msc.MassHexapole.Count; i++)
		{
			if (msc.MassHexapole[i].run)
			{
				HexList.Add(msc.MassHexapole[i].hexfactor);
				massList.Add(msc.MassHexapole[i].mass);
			}
		}
		if (HexList.Count < 4)
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.TipsText5.Text"));
			return;
		}
		LineItem line0 = graphHex.GraphPane.AddCurve(Lang.Txt("FormInstrumentCalibration.LinearHexapole.Text"), massList.ToArray(), HexList.ToArray(), Color.Red, SymbolType.Circle);
		if (order == 1)
		{
			line0.Line.IsVisible = true;
		}
		line0.Symbol.Fill.Type = FillType.Solid;
		graphHex.GraphPane.AxisChange();
		graphHex.Refresh();
	}

	private void button6_Click(object sender, EventArgs e)
	{
		if (msc.CreateTableHex(Detector.Instance.HexFaPath))
		{
			Detector.Instance.LoadLookupTableHex();
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.CreateTSuccess.Text"));
		}
		else
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.CreateTFailure.Text"));
		}
	}

	private void checkBox1_CheckedChanged(object sender, EventArgs e)
	{
		if (chkIsCalibration.Checked)
		{
			foreach (MassHexapole hex in msc.MassHexapole)
			{
				hex.hexcalibration = chkIsCalibration.Checked;
			}
			Detector.Instance.IsHexCalibration(chkIsCalibration.Checked);
			msc.Save2();
			return;
		}
		foreach (MassHexapole hex2 in msc.MassHexapole)
		{
			hex2.hexcalibration = chkIsCalibration.Checked;
		}
		Detector.Instance.IsHexCalibration(chkIsCalibration.Checked);
		msc.Save2();
	}

	private void dgvHexapole_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex == colStatus2.Index)
		{
			switch ((int)e.Value)
			{
			case 0:
				e.Value = Resources.PROCESS_READY;
				break;
			case 1:
				e.Value = Resources.PROCESS_PROCESSING;
				break;
			case 2:
				e.Value = Resources.PROCESS_RIGHT;
				break;
			case 3:
			case 4:
				e.Value = Resources.PROCESS_WRONG;
				break;
			}
			e.FormattingApplied = true;
		}
		else if (e.ColumnIndex == ColCoefficient.Index)
		{
			dgvHexapole.Rows[e.RowIndex].Cells["ColCoefficient"].ReadOnly = false;
			if (Convert.ToDouble(e.Value) < 0.0)
			{
				e.Value = null;
			}
			else
			{
				e.Value = $"{e.Value:0.000}";
			}
		}
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.components = new System.ComponentModel.Container();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
		System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ICP_MS.Plugin.Tune.FormInstrumentCalibration));
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
		this.tabControlCalibration = new System.Windows.Forms.TabControl();
		this.pageMass = new System.Windows.Forms.TabPage();
		this.gbMass = new System.Windows.Forms.GroupBox();
		this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
		this.dgvMass = new System.Windows.Forms.DataGridView();
		this.colStatus = new System.Windows.Forms.DataGridViewImageColumn();
		this.colSymbol2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colMass2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colCenter2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colError2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colWidth2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colMassRun = new System.Windows.Forms.DataGridViewCheckBoxColumn();
		this.tabControl1 = new System.Windows.Forms.TabControl();
		this.tabPage1 = new System.Windows.Forms.TabPage();
		this.graphMass = new ZedGraph.ZedGraphControl();
		this.tabPage2 = new System.Windows.Forms.TabPage();
		this.groupBox7 = new System.Windows.Forms.GroupBox();
		this.groupBox1 = new System.Windows.Forms.GroupBox();
		this.lblCoef = new System.Windows.Forms.Label();
		this.label1 = new System.Windows.Forms.Label();
		this.txtrdc = new System.Windows.Forms.TextBox();
		this.label2 = new System.Windows.Forms.Label();
		this.txtrrf = new System.Windows.Forms.TextBox();
		this.label3 = new System.Windows.Forms.Label();
		this.button1 = new System.Windows.Forms.Button();
		this.btnRefresh = new System.Windows.Forms.Button();
		this.groupBox2 = new System.Windows.Forms.GroupBox();
		this.comboBox1 = new System.Windows.Forms.ComboBox();
		this.graph = new ZedGraph.ZedGraphControl();
		this.toolStrip2 = new System.Windows.Forms.ToolStrip();
		this.tsbtnStartMass = new System.Windows.Forms.ToolStripButton();
		this.tsbtnStopMass = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
		this.tsbtnAdd = new System.Windows.Forms.ToolStripButton();
		this.tsbtnDelete = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
		this.tsbtnCreateMS = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
		this.tsbtnExportMass = new System.Windows.Forms.ToolStripButton();
		this.tsbtnImportMass = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
		this.tsbtnSelectAll = new System.Windows.Forms.ToolStripButton();
		this.tsbtnDeselectAll = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
		this.btnFile = new System.Windows.Forms.ToolStripButton();
		this.btnMassLog = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
		this.tsbtnLink = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
		this.tsbtnCheck = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
		this.tabPage3 = new System.Windows.Forms.TabPage();
		this.groupBox3 = new System.Windows.Forms.GroupBox();
		this.groupBox5 = new System.Windows.Forms.GroupBox();
		this.textBox2 = new System.Windows.Forms.TextBox();
		this.label4 = new System.Windows.Forms.Label();
		this.button3 = new System.Windows.Forms.Button();
		this.groupBox4 = new System.Windows.Forms.GroupBox();
		this.button4 = new System.Windows.Forms.Button();
		this.button5 = new System.Windows.Forms.Button();
		this.label6 = new System.Windows.Forms.Label();
		this.label7 = new System.Windows.Forms.Label();
		this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
		this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
		this.graphAcq = new ZedGraph.ZedGraphControl();
		this.panel1 = new System.Windows.Forms.Panel();
		this.PageDeadTime = new System.Windows.Forms.TabPage();
		this.button2 = new System.Windows.Forms.Button();
		this.btndeadTime = new System.Windows.Forms.Button();
		this.textBox1 = new System.Windows.Forms.TextBox();
		this.label5 = new System.Windows.Forms.Label();
		this.pagePA = new System.Windows.Forms.TabPage();
		this.tabHexapole = new System.Windows.Forms.TabPage();
		this.gbHexapole = new System.Windows.Forms.GroupBox();
		this.dgvHexapole = new System.Windows.Forms.DataGridView();
		this.colStatus2 = new System.Windows.Forms.DataGridViewImageColumn();
		this.ColElement = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ColMass = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ColCoefficient = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ColCalibration = new System.Windows.Forms.DataGridViewCheckBoxColumn();
		this.chkIsCalibration = new System.Windows.Forms.CheckBox();
		this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
		this.tabControl3 = new System.Windows.Forms.TabControl();
		this.tabPage7 = new System.Windows.Forms.TabPage();
		this.groupBox12 = new System.Windows.Forms.GroupBox();
		this.groupBox13 = new System.Windows.Forms.GroupBox();
		this.label12 = new System.Windows.Forms.Label();
		this.label13 = new System.Windows.Forms.Label();
		this.textBox5 = new System.Windows.Forms.TextBox();
		this.label14 = new System.Windows.Forms.Label();
		this.textBox6 = new System.Windows.Forms.TextBox();
		this.groupBox14 = new System.Windows.Forms.GroupBox();
		this.button6 = new System.Windows.Forms.Button();
		this.comboBox3 = new System.Windows.Forms.ComboBox();
		this.label15 = new System.Windows.Forms.Label();
		this.button9 = new System.Windows.Forms.Button();
		this.graphHex = new ZedGraph.ZedGraphControl();
		this.toolStrip1 = new System.Windows.Forms.ToolStrip();
		this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
		this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
		this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripButton5 = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripButton6 = new System.Windows.Forms.ToolStripButton();
		this.toolStripButton7 = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripButton8 = new System.Windows.Forms.ToolStripButton();
		this.toolStripButton9 = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator17 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripButton10 = new System.Windows.Forms.ToolStripButton();
		this.toolStripButton11 = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator18 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripButton12 = new System.Windows.Forms.ToolStripButton();
		this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewImageColumn1 = new System.Windows.Forms.DataGridViewImageColumn();
		this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn14 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn15 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn16 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.tabControlCalibration.SuspendLayout();
		this.pageMass.SuspendLayout();
		this.gbMass.SuspendLayout();
		this.tableLayoutPanel1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvMass).BeginInit();
		this.tabControl1.SuspendLayout();
		this.tabPage1.SuspendLayout();
		this.tabPage2.SuspendLayout();
		this.groupBox7.SuspendLayout();
		this.groupBox1.SuspendLayout();
		this.groupBox2.SuspendLayout();
		this.toolStrip2.SuspendLayout();
		this.tabPage3.SuspendLayout();
		this.groupBox3.SuspendLayout();
		this.groupBox5.SuspendLayout();
		this.groupBox4.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.numericUpDown2).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.numericUpDown1).BeginInit();
		this.PageDeadTime.SuspendLayout();
		this.tabHexapole.SuspendLayout();
		this.gbHexapole.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvHexapole).BeginInit();
		this.tableLayoutPanel3.SuspendLayout();
		this.tabControl3.SuspendLayout();
		this.tabPage7.SuspendLayout();
		this.groupBox12.SuspendLayout();
		this.groupBox13.SuspendLayout();
		this.groupBox14.SuspendLayout();
		this.toolStrip1.SuspendLayout();
		base.SuspendLayout();
		this.tabControlCalibration.Controls.Add(this.pageMass);
		this.tabControlCalibration.Controls.Add(this.tabPage3);
		this.tabControlCalibration.Controls.Add(this.PageDeadTime);
		this.tabControlCalibration.Controls.Add(this.pagePA);
		this.tabControlCalibration.Controls.Add(this.tabHexapole);
		this.tabControlCalibration.Dock = System.Windows.Forms.DockStyle.Fill;
		this.tabControlCalibration.Location = new System.Drawing.Point(0, 0);
		this.tabControlCalibration.Margin = new System.Windows.Forms.Padding(4);
		this.tabControlCalibration.Name = "tabControlCalibration";
		this.tabControlCalibration.SelectedIndex = 0;
		this.tabControlCalibration.Size = new System.Drawing.Size(1733, 749);
		this.tabControlCalibration.TabIndex = 0;
		this.pageMass.BackColor = System.Drawing.SystemColors.Control;
		this.pageMass.Controls.Add(this.gbMass);
		this.pageMass.Location = new System.Drawing.Point(4, 25);
		this.pageMass.Margin = new System.Windows.Forms.Padding(4);
		this.pageMass.Name = "pageMass";
		this.pageMass.Padding = new System.Windows.Forms.Padding(4);
		this.pageMass.Size = new System.Drawing.Size(1725, 720);
		this.pageMass.TabIndex = 3;
		this.pageMass.Text = "质量轴/分辨率校准";
		this.gbMass.Controls.Add(this.tableLayoutPanel1);
		this.gbMass.Controls.Add(this.toolStrip2);
		this.gbMass.Dock = System.Windows.Forms.DockStyle.Fill;
		this.gbMass.Location = new System.Drawing.Point(4, 4);
		this.gbMass.Margin = new System.Windows.Forms.Padding(4);
		this.gbMass.Name = "gbMass";
		this.gbMass.Padding = new System.Windows.Forms.Padding(4);
		this.gbMass.Size = new System.Drawing.Size(1717, 712);
		this.gbMass.TabIndex = 0;
		this.gbMass.TabStop = false;
		this.tableLayoutPanel1.ColumnCount = 1;
		this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50f));
		this.tableLayoutPanel1.Controls.Add(this.dgvMass, 0, 0);
		this.tableLayoutPanel1.Controls.Add(this.tabControl1, 0, 1);
		this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 49);
		this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);
		this.tableLayoutPanel1.Name = "tableLayoutPanel1";
		this.tableLayoutPanel1.RowCount = 2;
		this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50f));
		this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50f));
		this.tableLayoutPanel1.Size = new System.Drawing.Size(1709, 659);
		this.tableLayoutPanel1.TabIndex = 3;
		this.dgvMass.AllowUserToAddRows = false;
		this.dgvMass.AllowUserToDeleteRows = false;
		this.dgvMass.AllowUserToResizeRows = false;
		this.dgvMass.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
		dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		this.dgvMass.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
		this.dgvMass.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		this.dgvMass.Columns.AddRange(this.colStatus, this.colSymbol2, this.colMass2, this.colCenter2, this.colError2, this.colWidth2, this.colMassRun);
		dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle19.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.GradientActiveCaption;
		dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		this.dgvMass.DefaultCellStyle = dataGridViewCellStyle19;
		this.dgvMass.Dock = System.Windows.Forms.DockStyle.Fill;
		this.dgvMass.Location = new System.Drawing.Point(4, 4);
		this.dgvMass.Margin = new System.Windows.Forms.Padding(4);
		this.dgvMass.Name = "dgvMass";
		dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle20.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle20.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle20.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle20.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		this.dgvMass.RowHeadersDefaultCellStyle = dataGridViewCellStyle20;
		this.dgvMass.RowHeadersVisible = false;
		this.dgvMass.RowHeadersWidth = 51;
		this.dgvMass.RowTemplate.Height = 23;
		this.dgvMass.Size = new System.Drawing.Size(1701, 321);
		this.dgvMass.TabIndex = 1;
		this.dgvMass.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvMass_CellFormatting);
		this.dgvMass.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dgvMass_CellMouseDoubleClick);
		this.dgvMass.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dgvMass_CellMouseDown);
		this.dgvMass.CurrentCellDirtyStateChanged += new System.EventHandler(dgvMass_CurrentCellDirtyStateChanged);
		this.dgvMass.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(dgvMass_RowPostPaint);
		this.colStatus.DataPropertyName = "status";
		dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle12.NullValue = null;
		this.colStatus.DefaultCellStyle = dataGridViewCellStyle12;
		this.colStatus.HeaderText = "";
		this.colStatus.MinimumWidth = 6;
		this.colStatus.Name = "colStatus";
		this.colStatus.ReadOnly = true;
		this.colStatus.Resizable = System.Windows.Forms.DataGridViewTriState.True;
		this.colSymbol2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
		this.colSymbol2.DataPropertyName = "symbol";
		this.colSymbol2.HeaderText = "元素";
		this.colSymbol2.MinimumWidth = 6;
		this.colSymbol2.Name = "colSymbol2";
		this.colSymbol2.ReadOnly = true;
		this.colSymbol2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.colSymbol2.Width = 125;
		this.colMass2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colMass2.DataPropertyName = "mass";
		this.colMass2.HeaderText = "质量数";
		this.colMass2.MinimumWidth = 6;
		this.colMass2.Name = "colMass2";
		this.colMass2.ReadOnly = true;
		this.colMass2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.colCenter2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colCenter2.DataPropertyName = "center";
		this.colCenter2.HeaderText = "峰中心";
		this.colCenter2.MinimumWidth = 6;
		this.colCenter2.Name = "colCenter2";
		this.colCenter2.ReadOnly = true;
		this.colCenter2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.colError2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colError2.DataPropertyName = "error";
		this.colError2.HeaderText = "误差";
		this.colError2.MinimumWidth = 6;
		this.colError2.Name = "colError2";
		this.colError2.ReadOnly = true;
		this.colError2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.colWidth2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colWidth2.DataPropertyName = "width";
		this.colWidth2.HeaderText = "峰宽(10%)";
		this.colWidth2.MinimumWidth = 6;
		this.colWidth2.Name = "colWidth2";
		this.colWidth2.ReadOnly = true;
		this.colWidth2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.colMassRun.DataPropertyName = "run";
		this.colMassRun.FillWeight = 50f;
		this.colMassRun.HeaderText = "校正";
		this.colMassRun.MinimumWidth = 6;
		this.colMassRun.Name = "colMassRun";
		this.tabControl1.Controls.Add(this.tabPage1);
		this.tabControl1.Controls.Add(this.tabPage2);
		this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.tabControl1.Location = new System.Drawing.Point(4, 333);
		this.tabControl1.Margin = new System.Windows.Forms.Padding(4);
		this.tabControl1.Name = "tabControl1";
		this.tabControl1.SelectedIndex = 0;
		this.tabControl1.Size = new System.Drawing.Size(1701, 322);
		this.tabControl1.TabIndex = 2;
		this.tabPage1.Controls.Add(this.graphMass);
		this.tabPage1.Location = new System.Drawing.Point(4, 25);
		this.tabPage1.Margin = new System.Windows.Forms.Padding(4);
		this.tabPage1.Name = "tabPage1";
		this.tabPage1.Padding = new System.Windows.Forms.Padding(4);
		this.tabPage1.Size = new System.Drawing.Size(1693, 293);
		this.tabPage1.TabIndex = 0;
		this.tabPage1.Text = "扫描曲线";
		this.tabPage1.UseVisualStyleBackColor = true;
		this.graphMass.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
		this.graphMass.Dock = System.Windows.Forms.DockStyle.Fill;
		this.graphMass.Location = new System.Drawing.Point(4, 4);
		this.graphMass.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
		this.graphMass.Name = "graphMass";
		this.graphMass.ScrollGrace = 0.0;
		this.graphMass.ScrollMaxX = 0.0;
		this.graphMass.ScrollMaxY = 0.0;
		this.graphMass.ScrollMaxY2 = 0.0;
		this.graphMass.ScrollMinX = 0.0;
		this.graphMass.ScrollMinY = 0.0;
		this.graphMass.ScrollMinY2 = 0.0;
		this.graphMass.Size = new System.Drawing.Size(1685, 285);
		this.graphMass.TabIndex = 2;
		this.tabPage2.Controls.Add(this.groupBox7);
		this.tabPage2.Controls.Add(this.graph);
		this.tabPage2.Location = new System.Drawing.Point(4, 25);
		this.tabPage2.Margin = new System.Windows.Forms.Padding(4);
		this.tabPage2.Name = "tabPage2";
		this.tabPage2.Padding = new System.Windows.Forms.Padding(4);
		this.tabPage2.Size = new System.Drawing.Size(1693, 293);
		this.tabPage2.TabIndex = 1;
		this.tabPage2.Text = "拟合曲线";
		this.tabPage2.UseVisualStyleBackColor = true;
		this.groupBox7.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
		this.groupBox7.Controls.Add(this.groupBox1);
		this.groupBox7.Controls.Add(this.label3);
		this.groupBox7.Controls.Add(this.button1);
		this.groupBox7.Controls.Add(this.btnRefresh);
		this.groupBox7.Controls.Add(this.groupBox2);
		this.groupBox7.Location = new System.Drawing.Point(5, 8);
		this.groupBox7.Margin = new System.Windows.Forms.Padding(4);
		this.groupBox7.Name = "groupBox7";
		this.groupBox7.Padding = new System.Windows.Forms.Padding(4);
		this.groupBox7.Size = new System.Drawing.Size(256, 289);
		this.groupBox7.TabIndex = 8;
		this.groupBox7.TabStop = false;
		this.groupBox7.Text = "曲线参数";
		this.groupBox1.Controls.Add(this.lblCoef);
		this.groupBox1.Controls.Add(this.label1);
		this.groupBox1.Controls.Add(this.txtrdc);
		this.groupBox1.Controls.Add(this.label2);
		this.groupBox1.Controls.Add(this.txtrrf);
		this.groupBox1.Location = new System.Drawing.Point(257, 46);
		this.groupBox1.Name = "groupBox1";
		this.groupBox1.Size = new System.Drawing.Size(172, 183);
		this.groupBox1.TabIndex = 39;
		this.groupBox1.TabStop = false;
		this.groupBox1.Visible = false;
		this.lblCoef.AutoSize = true;
		this.lblCoef.Location = new System.Drawing.Point(88, 21);
		this.lblCoef.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblCoef.Name = "lblCoef";
		this.lblCoef.Size = new System.Drawing.Size(23, 15);
		this.lblCoef.TabIndex = 32;
		this.lblCoef.Text = "r:";
		this.label1.AutoSize = true;
		this.label1.Location = new System.Drawing.Point(11, 118);
		this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(31, 15);
		this.label1.TabIndex = 30;
		this.label1.Text = "rf:";
		this.txtrdc.Location = new System.Drawing.Point(50, 62);
		this.txtrdc.Margin = new System.Windows.Forms.Padding(4);
		this.txtrdc.Name = "txtrdc";
		this.txtrdc.ReadOnly = true;
		this.txtrdc.Size = new System.Drawing.Size(88, 25);
		this.txtrdc.TabIndex = 35;
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(11, 62);
		this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(31, 15);
		this.label2.TabIndex = 31;
		this.label2.Text = "dc:";
		this.txtrrf.Location = new System.Drawing.Point(50, 108);
		this.txtrrf.Margin = new System.Windows.Forms.Padding(4);
		this.txtrrf.Name = "txtrrf";
		this.txtrrf.ReadOnly = true;
		this.txtrrf.Size = new System.Drawing.Size(88, 25);
		this.txtrrf.TabIndex = 35;
		this.label3.AutoSize = true;
		this.label3.Location = new System.Drawing.Point(32, 73);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(67, 15);
		this.label3.TabIndex = 38;
		this.label3.Text = "拟合方式";
		this.button1.Location = new System.Drawing.Point(61, 170);
		this.button1.Margin = new System.Windows.Forms.Padding(4);
		this.button1.Name = "button1";
		this.button1.Size = new System.Drawing.Size(115, 25);
		this.button1.TabIndex = 13;
		this.button1.Text = "生成查找表";
		this.button1.UseVisualStyleBackColor = true;
		this.button1.Click += new System.EventHandler(button1_Click);
		this.btnRefresh.Location = new System.Drawing.Point(61, 126);
		this.btnRefresh.Margin = new System.Windows.Forms.Padding(4);
		this.btnRefresh.Name = "btnRefresh";
		this.btnRefresh.Size = new System.Drawing.Size(115, 25);
		this.btnRefresh.TabIndex = 13;
		this.btnRefresh.Text = "计算";
		this.btnRefresh.UseVisualStyleBackColor = true;
		this.btnRefresh.Click += new System.EventHandler(btnRefresh_Click);
		this.groupBox2.Controls.Add(this.comboBox1);
		this.groupBox2.Location = new System.Drawing.Point(18, 46);
		this.groupBox2.Name = "groupBox2";
		this.groupBox2.Size = new System.Drawing.Size(223, 183);
		this.groupBox2.TabIndex = 40;
		this.groupBox2.TabStop = false;
		this.comboBox1.FormattingEnabled = true;
		this.comboBox1.Items.AddRange(new object[2] { "一次拟合", "二次拟合" });
		this.comboBox1.Location = new System.Drawing.Point(87, 24);
		this.comboBox1.Name = "comboBox1";
		this.comboBox1.Size = new System.Drawing.Size(130, 23);
		this.comboBox1.TabIndex = 37;
		this.comboBox1.Text = "一次拟合";
		this.graph.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
		this.graph.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
		this.graph.Location = new System.Drawing.Point(276, 8);
		this.graph.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
		this.graph.Name = "graph";
		this.graph.ScrollGrace = 0.0;
		this.graph.ScrollMaxX = 0.0;
		this.graph.ScrollMaxY = 0.0;
		this.graph.ScrollMaxY2 = 0.0;
		this.graph.ScrollMinX = 0.0;
		this.graph.ScrollMinY = 0.0;
		this.graph.ScrollMinY2 = 0.0;
		this.graph.Size = new System.Drawing.Size(1413, 290);
		this.graph.TabIndex = 3;
		this.toolStrip2.ImageScalingSize = new System.Drawing.Size(20, 20);
		this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[23]
		{
			this.tsbtnStartMass, this.tsbtnStopMass, this.toolStripSeparator3, this.toolStripSeparator2, this.tsbtnAdd, this.tsbtnDelete, this.toolStripSeparator4, this.tsbtnCreateMS, this.toolStripSeparator7, this.tsbtnExportMass,
			this.tsbtnImportMass, this.toolStripSeparator9, this.toolStripSeparator8, this.tsbtnSelectAll, this.tsbtnDeselectAll, this.toolStripSeparator10, this.btnFile, this.btnMassLog, this.toolStripSeparator6, this.tsbtnLink,
			this.toolStripSeparator5, this.tsbtnCheck, this.toolStripSeparator1
		});
		this.toolStrip2.Location = new System.Drawing.Point(4, 22);
		this.toolStrip2.Name = "toolStrip2";
		this.toolStrip2.Size = new System.Drawing.Size(1709, 27);
		this.toolStrip2.TabIndex = 0;
		this.toolStrip2.Text = "toolStrip2";
		this.tsbtnStartMass.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnStartMass.Image = (System.Drawing.Image)resources.GetObject("tsbtnStartMass.Image");
		this.tsbtnStartMass.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnStartMass.Name = "tsbtnStartMass";
		this.tsbtnStartMass.Size = new System.Drawing.Size(29, 24);
		this.tsbtnStartMass.Text = "Start";
		this.tsbtnStartMass.Click += new System.EventHandler(tsbtnStartMass_Click);
		this.tsbtnStopMass.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnStopMass.Image = (System.Drawing.Image)resources.GetObject("tsbtnStopMass.Image");
		this.tsbtnStopMass.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnStopMass.Name = "tsbtnStopMass";
		this.tsbtnStopMass.Size = new System.Drawing.Size(29, 24);
		this.tsbtnStopMass.Text = "Start";
		this.tsbtnStopMass.Click += new System.EventHandler(tsbtnStopMass_Click);
		this.toolStripSeparator3.Name = "toolStripSeparator3";
		this.toolStripSeparator3.Size = new System.Drawing.Size(6, 27);
		this.toolStripSeparator2.Name = "toolStripSeparator2";
		this.toolStripSeparator2.Size = new System.Drawing.Size(6, 27);
		this.tsbtnAdd.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnAdd.Image = (System.Drawing.Image)resources.GetObject("tsbtnAdd.Image");
		this.tsbtnAdd.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnAdd.Name = "tsbtnAdd";
		this.tsbtnAdd.Size = new System.Drawing.Size(29, 24);
		this.tsbtnAdd.Text = "添加元素";
		this.tsbtnAdd.Click += new System.EventHandler(tsbtnAdd_Click);
		this.tsbtnDelete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnDelete.Image = (System.Drawing.Image)resources.GetObject("tsbtnDelete.Image");
		this.tsbtnDelete.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnDelete.Name = "tsbtnDelete";
		this.tsbtnDelete.Size = new System.Drawing.Size(29, 24);
		this.tsbtnDelete.Text = "删除元素";
		this.tsbtnDelete.Click += new System.EventHandler(tsbtnDelete_Click);
		this.toolStripSeparator4.Name = "toolStripSeparator4";
		this.toolStripSeparator4.Size = new System.Drawing.Size(6, 27);
		this.tsbtnCreateMS.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnCreateMS.Image = (System.Drawing.Image)resources.GetObject("tsbtnCreateMS.Image");
		this.tsbtnCreateMS.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnCreateMS.Name = "tsbtnCreateMS";
		this.tsbtnCreateMS.Size = new System.Drawing.Size(29, 24);
		this.tsbtnCreateMS.Text = "生成查找表";
		this.tsbtnCreateMS.Click += new System.EventHandler(tsbtnSave_Click);
		this.toolStripSeparator7.Name = "toolStripSeparator7";
		this.toolStripSeparator7.Size = new System.Drawing.Size(6, 27);
		this.tsbtnExportMass.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnExportMass.Image = (System.Drawing.Image)resources.GetObject("tsbtnExportMass.Image");
		this.tsbtnExportMass.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnExportMass.Name = "tsbtnExportMass";
		this.tsbtnExportMass.Size = new System.Drawing.Size(29, 24);
		this.tsbtnExportMass.Text = "导出";
		this.tsbtnExportMass.Click += new System.EventHandler(tsbtnExportMass_Click);
		this.tsbtnImportMass.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnImportMass.Image = (System.Drawing.Image)resources.GetObject("tsbtnImportMass.Image");
		this.tsbtnImportMass.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnImportMass.Name = "tsbtnImportMass";
		this.tsbtnImportMass.Size = new System.Drawing.Size(29, 24);
		this.tsbtnImportMass.Text = "导入";
		this.tsbtnImportMass.Click += new System.EventHandler(tsbtnImportMass_Click);
		this.toolStripSeparator9.Name = "toolStripSeparator9";
		this.toolStripSeparator9.Size = new System.Drawing.Size(6, 27);
		this.toolStripSeparator8.Name = "toolStripSeparator8";
		this.toolStripSeparator8.Size = new System.Drawing.Size(6, 27);
		this.tsbtnSelectAll.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnSelectAll.Image = (System.Drawing.Image)resources.GetObject("tsbtnSelectAll.Image");
		this.tsbtnSelectAll.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnSelectAll.Name = "tsbtnSelectAll";
		this.tsbtnSelectAll.Size = new System.Drawing.Size(29, 24);
		this.tsbtnSelectAll.Text = "选择全部";
		this.tsbtnSelectAll.Click += new System.EventHandler(tsbtnSelectAll_Click);
		this.tsbtnDeselectAll.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnDeselectAll.Image = (System.Drawing.Image)resources.GetObject("tsbtnDeselectAll.Image");
		this.tsbtnDeselectAll.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnDeselectAll.Name = "tsbtnDeselectAll";
		this.tsbtnDeselectAll.Size = new System.Drawing.Size(29, 24);
		this.tsbtnDeselectAll.Text = "取消全部";
		this.tsbtnDeselectAll.Click += new System.EventHandler(tsbtnDeselectAll_Click);
		this.toolStripSeparator10.Name = "toolStripSeparator10";
		this.toolStripSeparator10.Size = new System.Drawing.Size(6, 27);
		this.btnFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.btnFile.Image = (System.Drawing.Image)resources.GetObject("btnFile.Image");
		this.btnFile.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.btnFile.Name = "btnFile";
		this.btnFile.Size = new System.Drawing.Size(29, 24);
		this.btnFile.Text = "File";
		this.btnFile.Click += new System.EventHandler(btnFile_Click);
		this.btnMassLog.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.btnMassLog.Image = (System.Drawing.Image)resources.GetObject("btnMassLog.Image");
		this.btnMassLog.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.btnMassLog.Name = "btnMassLog";
		this.btnMassLog.Size = new System.Drawing.Size(29, 24);
		this.btnMassLog.Text = "Log";
		this.btnMassLog.Click += new System.EventHandler(btnMassLog_Click);
		this.toolStripSeparator6.Name = "toolStripSeparator6";
		this.toolStripSeparator6.Size = new System.Drawing.Size(6, 27);
		this.tsbtnLink.AutoSize = false;
		this.tsbtnLink.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnLink.Image = (System.Drawing.Image)resources.GetObject("tsbtnLink.Image");
		this.tsbtnLink.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnLink.Name = "tsbtnLink";
		this.tsbtnLink.Size = new System.Drawing.Size(24, 24);
		this.tsbtnLink.Text = "链接";
		this.tsbtnLink.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
		this.tsbtnLink.ToolTipText = "链接到质量轴/分辨率校正";
		this.tsbtnLink.Click += new System.EventHandler(tsbtnLink_Click);
		this.toolStripSeparator5.Name = "toolStripSeparator5";
		this.toolStripSeparator5.Size = new System.Drawing.Size(6, 27);
		this.tsbtnCheck.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnCheck.Image = (System.Drawing.Image)resources.GetObject("tsbtnCheck.Image");
		this.tsbtnCheck.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnCheck.Name = "tsbtnCheck";
		this.tsbtnCheck.Size = new System.Drawing.Size(29, 24);
		this.tsbtnCheck.Text = "检验";
		this.tsbtnCheck.Click += new System.EventHandler(tsbtnCheck_Click);
		this.toolStripSeparator1.Name = "toolStripSeparator1";
		this.toolStripSeparator1.Size = new System.Drawing.Size(6, 27);
		this.tabPage3.Controls.Add(this.groupBox3);
		this.tabPage3.Controls.Add(this.panel1);
		this.tabPage3.Location = new System.Drawing.Point(4, 25);
		this.tabPage3.Name = "tabPage3";
		this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
		this.tabPage3.Size = new System.Drawing.Size(1725, 720);
		this.tabPage3.TabIndex = 6;
		this.tabPage3.Text = "查找平台电压";
		this.tabPage3.UseVisualStyleBackColor = true;
		this.groupBox3.BackColor = System.Drawing.SystemColors.Control;
		this.groupBox3.Controls.Add(this.groupBox5);
		this.groupBox3.Controls.Add(this.groupBox4);
		this.groupBox3.Controls.Add(this.graphAcq);
		this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
		this.groupBox3.Location = new System.Drawing.Point(3, 3);
		this.groupBox3.Name = "groupBox3";
		this.groupBox3.Size = new System.Drawing.Size(1719, 714);
		this.groupBox3.TabIndex = 4;
		this.groupBox3.TabStop = false;
		this.groupBox3.Text = "正高压设置";
		this.groupBox5.Controls.Add(this.textBox2);
		this.groupBox5.Controls.Add(this.label4);
		this.groupBox5.Controls.Add(this.button3);
		this.groupBox5.Location = new System.Drawing.Point(703, 476);
		this.groupBox5.Name = "groupBox5";
		this.groupBox5.Size = new System.Drawing.Size(542, 92);
		this.groupBox5.TabIndex = 73;
		this.groupBox5.TabStop = false;
		this.groupBox5.Text = "设置";
		this.textBox2.Location = new System.Drawing.Point(147, 33);
		this.textBox2.Name = "textBox2";
		this.textBox2.Size = new System.Drawing.Size(110, 25);
		this.textBox2.TabIndex = 72;
		this.label4.AutoSize = true;
		this.label4.Location = new System.Drawing.Point(50, 36);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(91, 15);
		this.label4.TabIndex = 71;
		this.label4.Text = "推荐HVP值：";
		this.button3.Location = new System.Drawing.Point(310, 33);
		this.button3.Name = "button3";
		this.button3.Size = new System.Drawing.Size(133, 27);
		this.button3.TabIndex = 70;
		this.button3.Text = "设置";
		this.button3.UseVisualStyleBackColor = true;
		this.button3.Click += new System.EventHandler(button3_Click);
		this.groupBox4.Controls.Add(this.button4);
		this.groupBox4.Controls.Add(this.button5);
		this.groupBox4.Controls.Add(this.label6);
		this.groupBox4.Controls.Add(this.label7);
		this.groupBox4.Controls.Add(this.numericUpDown2);
		this.groupBox4.Controls.Add(this.numericUpDown1);
		this.groupBox4.Location = new System.Drawing.Point(7, 476);
		this.groupBox4.Name = "groupBox4";
		this.groupBox4.Size = new System.Drawing.Size(636, 92);
		this.groupBox4.TabIndex = 69;
		this.groupBox4.TabStop = false;
		this.groupBox4.Text = "查找";
		this.button4.Location = new System.Drawing.Point(517, 31);
		this.button4.Name = "button4";
		this.button4.Size = new System.Drawing.Size(113, 31);
		this.button4.TabIndex = 3;
		this.button4.Text = "停止";
		this.button4.UseVisualStyleBackColor = true;
		this.button4.Click += new System.EventHandler(button4_Click);
		this.button5.Location = new System.Drawing.Point(360, 31);
		this.button5.Name = "button5";
		this.button5.Size = new System.Drawing.Size(113, 31);
		this.button5.TabIndex = 3;
		this.button5.Text = "查找";
		this.button5.UseVisualStyleBackColor = true;
		this.button5.Click += new System.EventHandler(button5_Click);
		this.label6.AutoSize = true;
		this.label6.Location = new System.Drawing.Point(44, 36);
		this.label6.Name = "label6";
		this.label6.Size = new System.Drawing.Size(67, 15);
		this.label6.TabIndex = 2;
		this.label6.Text = "高压差：";
		this.label7.AutoSize = true;
		this.label7.Location = new System.Drawing.Point(207, 36);
		this.label7.Name = "label7";
		this.label7.Size = new System.Drawing.Size(23, 15);
		this.label7.TabIndex = 1;
		this.label7.Text = "--";
		this.numericUpDown2.Location = new System.Drawing.Point(236, 34);
		this.numericUpDown2.Maximum = new decimal(new int[4] { 10000, 0, 0, 0 });
		this.numericUpDown2.Name = "numericUpDown2";
		this.numericUpDown2.Size = new System.Drawing.Size(73, 25);
		this.numericUpDown2.TabIndex = 0;
		this.numericUpDown2.Value = new decimal(new int[4] { 4000, 0, 0, 0 });
		this.numericUpDown1.Location = new System.Drawing.Point(128, 34);
		this.numericUpDown1.Maximum = new decimal(new int[4] { 10000, 0, 0, 0 });
		this.numericUpDown1.Name = "numericUpDown1";
		this.numericUpDown1.Size = new System.Drawing.Size(73, 25);
		this.numericUpDown1.TabIndex = 0;
		this.numericUpDown1.Value = new decimal(new int[4] { 2400, 0, 0, 0 });
		this.graphAcq.Location = new System.Drawing.Point(7, 25);
		this.graphAcq.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
		this.graphAcq.Name = "graphAcq";
		this.graphAcq.ScrollGrace = 0.0;
		this.graphAcq.ScrollMaxX = 0.0;
		this.graphAcq.ScrollMaxY = 0.0;
		this.graphAcq.ScrollMaxY2 = 0.0;
		this.graphAcq.ScrollMinX = 0.0;
		this.graphAcq.ScrollMinY = 0.0;
		this.graphAcq.ScrollMinY2 = 0.0;
		this.graphAcq.Size = new System.Drawing.Size(1333, 434);
		this.graphAcq.TabIndex = 68;
		this.panel1.BackColor = System.Drawing.SystemColors.Control;
		this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panel1.Location = new System.Drawing.Point(3, 3);
		this.panel1.Name = "panel1";
		this.panel1.Size = new System.Drawing.Size(1719, 714);
		this.panel1.TabIndex = 0;
		this.PageDeadTime.BackColor = System.Drawing.SystemColors.Control;
		this.PageDeadTime.Controls.Add(this.button2);
		this.PageDeadTime.Controls.Add(this.btndeadTime);
		this.PageDeadTime.Controls.Add(this.textBox1);
		this.PageDeadTime.Controls.Add(this.label5);
		this.PageDeadTime.Location = new System.Drawing.Point(4, 25);
		this.PageDeadTime.Name = "PageDeadTime";
		this.PageDeadTime.Padding = new System.Windows.Forms.Padding(3);
		this.PageDeadTime.Size = new System.Drawing.Size(1725, 720);
		this.PageDeadTime.TabIndex = 5;
		this.PageDeadTime.Text = "死时间校正";
		this.button2.Location = new System.Drawing.Point(326, 66);
		this.button2.Name = "button2";
		this.button2.Size = new System.Drawing.Size(142, 33);
		this.button2.TabIndex = 2;
		this.button2.Text = "置0";
		this.button2.UseVisualStyleBackColor = true;
		this.button2.Click += new System.EventHandler(button2_Click);
		this.btndeadTime.Location = new System.Drawing.Point(326, 15);
		this.btndeadTime.Name = "btndeadTime";
		this.btndeadTime.Size = new System.Drawing.Size(142, 33);
		this.btndeadTime.TabIndex = 2;
		this.btndeadTime.Text = "死时间校正";
		this.btndeadTime.UseVisualStyleBackColor = true;
		this.btndeadTime.Click += new System.EventHandler(btndeadTime_Click);
		this.textBox1.Location = new System.Drawing.Point(118, 21);
		this.textBox1.Name = "textBox1";
		this.textBox1.ReadOnly = true;
		this.textBox1.Size = new System.Drawing.Size(136, 25);
		this.textBox1.TabIndex = 1;
		this.label5.AutoSize = true;
		this.label5.Location = new System.Drawing.Point(18, 24);
		this.label5.Name = "label5";
		this.label5.Size = new System.Drawing.Size(67, 15);
		this.label5.TabIndex = 0;
		this.label5.Text = "死时间：";
		this.pagePA.Location = new System.Drawing.Point(4, 25);
		this.pagePA.Name = "pagePA";
		this.pagePA.Padding = new System.Windows.Forms.Padding(3);
		this.pagePA.Size = new System.Drawing.Size(1725, 720);
		this.pagePA.TabIndex = 4;
		this.pagePA.Text = "检测器交叉校正";
		this.pagePA.UseVisualStyleBackColor = true;
		this.tabHexapole.Controls.Add(this.gbHexapole);
		this.tabHexapole.Location = new System.Drawing.Point(4, 25);
		this.tabHexapole.Name = "tabHexapole";
		this.tabHexapole.Size = new System.Drawing.Size(1725, 720);
		this.tabHexapole.TabIndex = 7;
		this.tabHexapole.Text = "六极杆校正";
		this.tabHexapole.UseVisualStyleBackColor = true;
		this.gbHexapole.Controls.Add(this.dgvHexapole);
		this.gbHexapole.Controls.Add(this.chkIsCalibration);
		this.gbHexapole.Controls.Add(this.tableLayoutPanel3);
		this.gbHexapole.Controls.Add(this.toolStrip1);
		this.gbHexapole.Location = new System.Drawing.Point(2, 4);
		this.gbHexapole.Margin = new System.Windows.Forms.Padding(4);
		this.gbHexapole.Name = "gbHexapole";
		this.gbHexapole.Padding = new System.Windows.Forms.Padding(4);
		this.gbHexapole.Size = new System.Drawing.Size(1721, 712);
		this.gbHexapole.TabIndex = 4;
		this.gbHexapole.TabStop = false;
		this.dgvHexapole.AllowUserToAddRows = false;
		this.dgvHexapole.AllowUserToDeleteRows = false;
		this.dgvHexapole.AllowUserToResizeRows = false;
		dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle21.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle21.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		dataGridViewCellStyle21.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle21.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle21.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		this.dgvHexapole.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle21;
		this.dgvHexapole.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		this.dgvHexapole.Columns.AddRange(this.colStatus2, this.ColElement, this.ColMass, this.ColCoefficient, this.ColCalibration);
		dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle23.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle23.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle23.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle23.SelectionBackColor = System.Drawing.SystemColors.GradientActiveCaption;
		dataGridViewCellStyle23.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle23.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		this.dgvHexapole.DefaultCellStyle = dataGridViewCellStyle23;
		this.dgvHexapole.Location = new System.Drawing.Point(17, 53);
		this.dgvHexapole.Margin = new System.Windows.Forms.Padding(4);
		this.dgvHexapole.Name = "dgvHexapole";
		dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle24.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle24.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		this.dgvHexapole.RowHeadersDefaultCellStyle = dataGridViewCellStyle24;
		this.dgvHexapole.RowHeadersVisible = false;
		this.dgvHexapole.RowHeadersWidth = 51;
		this.dgvHexapole.RowTemplate.Height = 23;
		this.dgvHexapole.Size = new System.Drawing.Size(1150, 282);
		this.dgvHexapole.TabIndex = 1;
		this.dgvHexapole.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvHexapole_CellFormatting);
		this.colStatus2.DataPropertyName = "status";
		dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle22.NullValue = null;
		this.colStatus2.DefaultCellStyle = dataGridViewCellStyle22;
		this.colStatus2.HeaderText = "";
		this.colStatus2.MinimumWidth = 6;
		this.colStatus2.Name = "colStatus2";
		this.colStatus2.ReadOnly = true;
		this.colStatus2.Resizable = System.Windows.Forms.DataGridViewTriState.True;
		this.colStatus2.Width = 30;
		this.ColElement.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
		this.ColElement.DataPropertyName = "symbol";
		this.ColElement.HeaderText = "元素";
		this.ColElement.MinimumWidth = 6;
		this.ColElement.Name = "ColElement";
		this.ColElement.ReadOnly = true;
		this.ColElement.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.ColElement.Width = 125;
		this.ColMass.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.ColMass.DataPropertyName = "mass";
		this.ColMass.HeaderText = "质量数";
		this.ColMass.MinimumWidth = 6;
		this.ColMass.Name = "ColMass";
		this.ColMass.ReadOnly = true;
		this.ColMass.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.ColCoefficient.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.ColCoefficient.DataPropertyName = "hexfactor";
		this.ColCoefficient.HeaderText = "六极杆系数";
		this.ColCoefficient.MinimumWidth = 6;
		this.ColCoefficient.Name = "ColCoefficient";
		this.ColCoefficient.ReadOnly = true;
		this.ColCoefficient.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.ColCalibration.DataPropertyName = "run";
		this.ColCalibration.FillWeight = 50f;
		this.ColCalibration.HeaderText = "校正";
		this.ColCalibration.MinimumWidth = 6;
		this.ColCalibration.Name = "ColCalibration";
		this.ColCalibration.Width = 125;
		this.chkIsCalibration.AutoSize = true;
		this.chkIsCalibration.Location = new System.Drawing.Point(481, 27);
		this.chkIsCalibration.Name = "chkIsCalibration";
		this.chkIsCalibration.Size = new System.Drawing.Size(89, 19);
		this.chkIsCalibration.TabIndex = 4;
		this.chkIsCalibration.Text = "是否校正";
		this.chkIsCalibration.UseVisualStyleBackColor = true;
		this.chkIsCalibration.CheckedChanged += new System.EventHandler(checkBox1_CheckedChanged);
		this.tableLayoutPanel3.ColumnCount = 1;
		this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50f));
		this.tableLayoutPanel3.Controls.Add(this.tabControl3, 0, 1);
		this.tableLayoutPanel3.Location = new System.Drawing.Point(4, 49);
		this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(4);
		this.tableLayoutPanel3.Name = "tableLayoutPanel3";
		this.tableLayoutPanel3.RowCount = 2;
		this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 44.42748f));
		this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 55.57252f));
		this.tableLayoutPanel3.Size = new System.Drawing.Size(1163, 655);
		this.tableLayoutPanel3.TabIndex = 3;
		this.tabControl3.Controls.Add(this.tabPage7);
		this.tabControl3.Location = new System.Drawing.Point(4, 294);
		this.tabControl3.Margin = new System.Windows.Forms.Padding(4);
		this.tabControl3.Name = "tabControl3";
		this.tabControl3.SelectedIndex = 0;
		this.tabControl3.Size = new System.Drawing.Size(1155, 356);
		this.tabControl3.TabIndex = 2;
		this.tabPage7.Controls.Add(this.groupBox12);
		this.tabPage7.Controls.Add(this.graphHex);
		this.tabPage7.Location = new System.Drawing.Point(4, 25);
		this.tabPage7.Margin = new System.Windows.Forms.Padding(4);
		this.tabPage7.Name = "tabPage7";
		this.tabPage7.Padding = new System.Windows.Forms.Padding(4);
		this.tabPage7.Size = new System.Drawing.Size(1147, 327);
		this.tabPage7.TabIndex = 1;
		this.tabPage7.Text = "拟合曲线";
		this.tabPage7.UseVisualStyleBackColor = true;
		this.groupBox12.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
		this.groupBox12.Controls.Add(this.groupBox13);
		this.groupBox12.Controls.Add(this.groupBox14);
		this.groupBox12.Location = new System.Drawing.Point(5, 8);
		this.groupBox12.Margin = new System.Windows.Forms.Padding(4);
		this.groupBox12.Name = "groupBox12";
		this.groupBox12.Padding = new System.Windows.Forms.Padding(4);
		this.groupBox12.Size = new System.Drawing.Size(256, 285);
		this.groupBox12.TabIndex = 8;
		this.groupBox12.TabStop = false;
		this.groupBox12.Text = "曲线参数";
		this.groupBox13.Controls.Add(this.label12);
		this.groupBox13.Controls.Add(this.label13);
		this.groupBox13.Controls.Add(this.textBox5);
		this.groupBox13.Controls.Add(this.label14);
		this.groupBox13.Controls.Add(this.textBox6);
		this.groupBox13.Location = new System.Drawing.Point(257, 46);
		this.groupBox13.Name = "groupBox13";
		this.groupBox13.Size = new System.Drawing.Size(172, 183);
		this.groupBox13.TabIndex = 39;
		this.groupBox13.TabStop = false;
		this.groupBox13.Visible = false;
		this.label12.AutoSize = true;
		this.label12.Location = new System.Drawing.Point(88, 21);
		this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label12.Name = "label12";
		this.label12.Size = new System.Drawing.Size(23, 15);
		this.label12.TabIndex = 32;
		this.label12.Text = "r:";
		this.label13.AutoSize = true;
		this.label13.Location = new System.Drawing.Point(11, 118);
		this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label13.Name = "label13";
		this.label13.Size = new System.Drawing.Size(31, 15);
		this.label13.TabIndex = 30;
		this.label13.Text = "rf:";
		this.textBox5.Location = new System.Drawing.Point(50, 62);
		this.textBox5.Margin = new System.Windows.Forms.Padding(4);
		this.textBox5.Name = "textBox5";
		this.textBox5.ReadOnly = true;
		this.textBox5.Size = new System.Drawing.Size(88, 25);
		this.textBox5.TabIndex = 35;
		this.label14.AutoSize = true;
		this.label14.Location = new System.Drawing.Point(11, 62);
		this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label14.Name = "label14";
		this.label14.Size = new System.Drawing.Size(31, 15);
		this.label14.TabIndex = 31;
		this.label14.Text = "dc:";
		this.textBox6.Location = new System.Drawing.Point(50, 108);
		this.textBox6.Margin = new System.Windows.Forms.Padding(4);
		this.textBox6.Name = "textBox6";
		this.textBox6.ReadOnly = true;
		this.textBox6.Size = new System.Drawing.Size(88, 25);
		this.textBox6.TabIndex = 35;
		this.groupBox14.Controls.Add(this.button6);
		this.groupBox14.Controls.Add(this.comboBox3);
		this.groupBox14.Controls.Add(this.label15);
		this.groupBox14.Controls.Add(this.button9);
		this.groupBox14.Location = new System.Drawing.Point(18, 25);
		this.groupBox14.Name = "groupBox14";
		this.groupBox14.Size = new System.Drawing.Size(223, 253);
		this.groupBox14.TabIndex = 40;
		this.groupBox14.TabStop = false;
		this.button6.Location = new System.Drawing.Point(47, 158);
		this.button6.Margin = new System.Windows.Forms.Padding(4);
		this.button6.Name = "button6";
		this.button6.Size = new System.Drawing.Size(115, 25);
		this.button6.TabIndex = 39;
		this.button6.Text = "生成查找表";
		this.button6.UseVisualStyleBackColor = true;
		this.button6.Click += new System.EventHandler(button6_Click);
		this.comboBox3.FormattingEnabled = true;
		this.comboBox3.Items.AddRange(new object[2] { "分段拟合", "插值拟合" });
		this.comboBox3.Location = new System.Drawing.Point(101, 51);
		this.comboBox3.Name = "comboBox3";
		this.comboBox3.Size = new System.Drawing.Size(116, 23);
		this.comboBox3.TabIndex = 37;
		this.comboBox3.Text = "分段拟合";
		this.label15.AutoSize = true;
		this.label15.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		this.label15.Location = new System.Drawing.Point(6, 52);
		this.label15.Name = "label15";
		this.label15.Size = new System.Drawing.Size(89, 18);
		this.label15.TabIndex = 38;
		this.label15.Text = "拟合方式:";
		this.button9.Location = new System.Drawing.Point(47, 107);
		this.button9.Margin = new System.Windows.Forms.Padding(4);
		this.button9.Name = "button9";
		this.button9.Size = new System.Drawing.Size(115, 25);
		this.button9.TabIndex = 13;
		this.button9.Text = "计算";
		this.button9.UseVisualStyleBackColor = true;
		this.button9.Click += new System.EventHandler(button9_Click);
		this.graphHex.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
		this.graphHex.Location = new System.Drawing.Point(276, 8);
		this.graphHex.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
		this.graphHex.Name = "graphHex";
		this.graphHex.ScrollGrace = 0.0;
		this.graphHex.ScrollMaxX = 0.0;
		this.graphHex.ScrollMaxY = 0.0;
		this.graphHex.ScrollMaxY2 = 0.0;
		this.graphHex.ScrollMinX = 0.0;
		this.graphHex.ScrollMinY = 0.0;
		this.graphHex.ScrollMinY2 = 0.0;
		this.graphHex.Size = new System.Drawing.Size(862, 315);
		this.graphHex.TabIndex = 3;
		this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;
		this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
		this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[21]
		{
			this.toolStripButton1, this.toolStripButton2, this.toolStripSeparator11, this.toolStripSeparator12, this.toolStripButton3, this.toolStripButton4, this.toolStripSeparator13, this.toolStripButton5, this.toolStripSeparator14, this.toolStripButton6,
			this.toolStripButton7, this.toolStripSeparator15, this.toolStripSeparator16, this.toolStripButton8, this.toolStripButton9, this.toolStripSeparator17, this.toolStripButton10, this.toolStripButton11, this.toolStripSeparator18, this.toolStripSeparator19,
			this.toolStripButton12
		});
		this.toolStrip1.Location = new System.Drawing.Point(4, 22);
		this.toolStrip1.Name = "toolStrip1";
		this.toolStrip1.Size = new System.Drawing.Size(415, 27);
		this.toolStrip1.TabIndex = 0;
		this.toolStrip1.Text = "toolStrip1";
		this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton1.Image = (System.Drawing.Image)resources.GetObject("toolStripButton1.Image");
		this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton1.Name = "toolStripButton1";
		this.toolStripButton1.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton1.Text = "Start";
		this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton2.Image = (System.Drawing.Image)resources.GetObject("toolStripButton2.Image");
		this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton2.Name = "toolStripButton2";
		this.toolStripButton2.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton2.Text = "Start";
		this.toolStripSeparator11.Name = "toolStripSeparator11";
		this.toolStripSeparator11.Size = new System.Drawing.Size(6, 27);
		this.toolStripSeparator12.Name = "toolStripSeparator12";
		this.toolStripSeparator12.Size = new System.Drawing.Size(6, 27);
		this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton3.Image = (System.Drawing.Image)resources.GetObject("toolStripButton3.Image");
		this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton3.Name = "toolStripButton3";
		this.toolStripButton3.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton3.Text = "添加元素";
		this.toolStripButton3.Click += new System.EventHandler(toolStripButton3_Click);
		this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton4.Image = (System.Drawing.Image)resources.GetObject("toolStripButton4.Image");
		this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton4.Name = "toolStripButton4";
		this.toolStripButton4.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton4.Text = "删除元素";
		this.toolStripButton4.Click += new System.EventHandler(toolStripButton4_Click);
		this.toolStripSeparator13.Name = "toolStripSeparator13";
		this.toolStripSeparator13.Size = new System.Drawing.Size(6, 27);
		this.toolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton5.Image = (System.Drawing.Image)resources.GetObject("toolStripButton5.Image");
		this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton5.Name = "toolStripButton5";
		this.toolStripButton5.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton5.Text = "生成查找表";
		this.toolStripSeparator14.Name = "toolStripSeparator14";
		this.toolStripSeparator14.Size = new System.Drawing.Size(6, 27);
		this.toolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton6.Image = (System.Drawing.Image)resources.GetObject("toolStripButton6.Image");
		this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton6.Name = "toolStripButton6";
		this.toolStripButton6.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton6.Text = "导出";
		this.toolStripButton7.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton7.Image = (System.Drawing.Image)resources.GetObject("toolStripButton7.Image");
		this.toolStripButton7.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton7.Name = "toolStripButton7";
		this.toolStripButton7.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton7.Text = "导入";
		this.toolStripSeparator15.Name = "toolStripSeparator15";
		this.toolStripSeparator15.Size = new System.Drawing.Size(6, 27);
		this.toolStripSeparator16.Name = "toolStripSeparator16";
		this.toolStripSeparator16.Size = new System.Drawing.Size(6, 27);
		this.toolStripButton8.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton8.Image = (System.Drawing.Image)resources.GetObject("toolStripButton8.Image");
		this.toolStripButton8.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton8.Name = "toolStripButton8";
		this.toolStripButton8.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton8.Text = "选择全部";
		this.toolStripButton8.Click += new System.EventHandler(toolStripButton8_Click);
		this.toolStripButton9.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton9.Image = (System.Drawing.Image)resources.GetObject("toolStripButton9.Image");
		this.toolStripButton9.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton9.Name = "toolStripButton9";
		this.toolStripButton9.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton9.Text = "取消全部";
		this.toolStripSeparator17.Name = "toolStripSeparator17";
		this.toolStripSeparator17.Size = new System.Drawing.Size(6, 27);
		this.toolStripButton10.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton10.Image = (System.Drawing.Image)resources.GetObject("toolStripButton10.Image");
		this.toolStripButton10.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton10.Name = "toolStripButton10";
		this.toolStripButton10.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton10.Text = "File";
		this.toolStripButton11.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton11.Image = (System.Drawing.Image)resources.GetObject("toolStripButton11.Image");
		this.toolStripButton11.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton11.Name = "toolStripButton11";
		this.toolStripButton11.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton11.Text = "Log";
		this.toolStripSeparator18.Name = "toolStripSeparator18";
		this.toolStripSeparator18.Size = new System.Drawing.Size(6, 27);
		this.toolStripSeparator19.Name = "toolStripSeparator19";
		this.toolStripSeparator19.Size = new System.Drawing.Size(6, 27);
		this.toolStripButton12.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton12.Image = (System.Drawing.Image)resources.GetObject("toolStripButton12.Image");
		this.toolStripButton12.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton12.Name = "toolStripButton12";
		this.toolStripButton12.Size = new System.Drawing.Size(29, 24);
		this.toolStripButton12.Text = "toolStripButton12";
		this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn1.DataPropertyName = "symbol";
		dataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle25;
		this.dataGridViewTextBoxColumn1.HeaderText = "符号";
		this.dataGridViewTextBoxColumn1.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
		this.dataGridViewTextBoxColumn1.ReadOnly = true;
		this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn2.DataPropertyName = "mass";
		dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle2;
		this.dataGridViewTextBoxColumn2.HeaderText = "质量数";
		this.dataGridViewTextBoxColumn2.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
		this.dataGridViewTextBoxColumn2.ReadOnly = true;
		this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn3.DataPropertyName = "dac";
		dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle3;
		this.dataGridViewTextBoxColumn3.HeaderText = "计数";
		this.dataGridViewTextBoxColumn3.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
		this.dataGridViewTextBoxColumn3.ReadOnly = true;
		this.dataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn4.DataPropertyName = "width";
		dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle4;
		this.dataGridViewTextBoxColumn4.HeaderText = "峰宽(AMU)";
		this.dataGridViewTextBoxColumn4.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
		this.dataGridViewTextBoxColumn4.ReadOnly = true;
		this.dataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn5.DataPropertyName = "error";
		dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn5.DefaultCellStyle = dataGridViewCellStyle5;
		this.dataGridViewTextBoxColumn5.HeaderText = "误差";
		this.dataGridViewTextBoxColumn5.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
		this.dataGridViewTextBoxColumn5.ReadOnly = true;
		this.dataGridViewImageColumn1.DataPropertyName = "status";
		dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle6.NullValue = null;
		this.dataGridViewImageColumn1.DefaultCellStyle = dataGridViewCellStyle6;
		this.dataGridViewImageColumn1.HeaderText = "";
		this.dataGridViewImageColumn1.MinimumWidth = 6;
		this.dataGridViewImageColumn1.Name = "dataGridViewImageColumn1";
		this.dataGridViewImageColumn1.ReadOnly = true;
		this.dataGridViewImageColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True;
		this.dataGridViewImageColumn1.Width = 30;
		this.dataGridViewTextBoxColumn6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn6.DataPropertyName = "resolution";
		dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle7;
		this.dataGridViewTextBoxColumn6.HeaderText = "分辨率";
		this.dataGridViewTextBoxColumn6.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
		this.dataGridViewTextBoxColumn6.ReadOnly = true;
		this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn7.DataPropertyName = "time";
		dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle8;
		this.dataGridViewTextBoxColumn7.HeaderText = "时间";
		this.dataGridViewTextBoxColumn7.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
		this.dataGridViewTextBoxColumn7.ReadOnly = true;
		this.dataGridViewTextBoxColumn7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn8.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn8.DataPropertyName = "coef0";
		dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle9;
		this.dataGridViewTextBoxColumn8.HeaderText = "系数0";
		this.dataGridViewTextBoxColumn8.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
		this.dataGridViewTextBoxColumn8.ReadOnly = true;
		this.dataGridViewTextBoxColumn8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn9.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn9.DataPropertyName = "coef1";
		dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn9.DefaultCellStyle = dataGridViewCellStyle10;
		this.dataGridViewTextBoxColumn9.HeaderText = "系数1";
		this.dataGridViewTextBoxColumn9.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
		this.dataGridViewTextBoxColumn9.ReadOnly = true;
		this.dataGridViewTextBoxColumn9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn10.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn10.DataPropertyName = "coef2";
		dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn10.DefaultCellStyle = dataGridViewCellStyle11;
		this.dataGridViewTextBoxColumn10.HeaderText = "系数2";
		this.dataGridViewTextBoxColumn10.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
		this.dataGridViewTextBoxColumn10.ReadOnly = true;
		this.dataGridViewTextBoxColumn10.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn11.DataPropertyName = "note";
		dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn11.DefaultCellStyle = dataGridViewCellStyle13;
		this.dataGridViewTextBoxColumn11.HeaderText = "备注";
		this.dataGridViewTextBoxColumn11.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
		this.dataGridViewTextBoxColumn11.ReadOnly = true;
		this.dataGridViewTextBoxColumn11.Width = 125;
		this.dataGridViewTextBoxColumn12.DataPropertyName = "time";
		dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn12.DefaultCellStyle = dataGridViewCellStyle14;
		this.dataGridViewTextBoxColumn12.HeaderText = "时间";
		this.dataGridViewTextBoxColumn12.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
		this.dataGridViewTextBoxColumn12.ReadOnly = true;
		this.dataGridViewTextBoxColumn12.Width = 125;
		this.dataGridViewTextBoxColumn13.DataPropertyName = "coef0";
		dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn13.DefaultCellStyle = dataGridViewCellStyle15;
		this.dataGridViewTextBoxColumn13.HeaderText = "系数0";
		this.dataGridViewTextBoxColumn13.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13";
		this.dataGridViewTextBoxColumn13.ReadOnly = true;
		this.dataGridViewTextBoxColumn13.Width = 125;
		this.dataGridViewTextBoxColumn14.DataPropertyName = "coef1";
		dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn14.DefaultCellStyle = dataGridViewCellStyle16;
		this.dataGridViewTextBoxColumn14.HeaderText = "系数1";
		this.dataGridViewTextBoxColumn14.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn14.Name = "dataGridViewTextBoxColumn14";
		this.dataGridViewTextBoxColumn14.ReadOnly = true;
		this.dataGridViewTextBoxColumn14.Width = 125;
		this.dataGridViewTextBoxColumn15.DataPropertyName = "coef2";
		dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn15.DefaultCellStyle = dataGridViewCellStyle17;
		this.dataGridViewTextBoxColumn15.HeaderText = "系数2";
		this.dataGridViewTextBoxColumn15.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn15.Name = "dataGridViewTextBoxColumn15";
		this.dataGridViewTextBoxColumn15.ReadOnly = true;
		this.dataGridViewTextBoxColumn15.Width = 125;
		this.dataGridViewTextBoxColumn16.DataPropertyName = "note";
		dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn16.DefaultCellStyle = dataGridViewCellStyle18;
		this.dataGridViewTextBoxColumn16.HeaderText = "备注";
		this.dataGridViewTextBoxColumn16.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn16.Name = "dataGridViewTextBoxColumn16";
		this.dataGridViewTextBoxColumn16.ReadOnly = true;
		this.dataGridViewTextBoxColumn16.Width = 125;
		base.AutoScaleDimensions = new System.Drawing.SizeF(8f, 15f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(1733, 749);
		base.Controls.Add(this.tabControlCalibration);
		base.Margin = new System.Windows.Forms.Padding(4);
		base.Name = "FormInstrumentCalibration";
		base.ShowIcon = false;
		this.Text = "FormInstrumentCalibration";
		base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormInstrumentCalibration_FormClosing);
		base.Load += new System.EventHandler(FormInstrumentCalibration_Load);
		this.tabControlCalibration.ResumeLayout(false);
		this.pageMass.ResumeLayout(false);
		this.gbMass.ResumeLayout(false);
		this.gbMass.PerformLayout();
		this.tableLayoutPanel1.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvMass).EndInit();
		this.tabControl1.ResumeLayout(false);
		this.tabPage1.ResumeLayout(false);
		this.tabPage2.ResumeLayout(false);
		this.groupBox7.ResumeLayout(false);
		this.groupBox7.PerformLayout();
		this.groupBox1.ResumeLayout(false);
		this.groupBox1.PerformLayout();
		this.groupBox2.ResumeLayout(false);
		this.toolStrip2.ResumeLayout(false);
		this.toolStrip2.PerformLayout();
		this.tabPage3.ResumeLayout(false);
		this.groupBox3.ResumeLayout(false);
		this.groupBox5.ResumeLayout(false);
		this.groupBox5.PerformLayout();
		this.groupBox4.ResumeLayout(false);
		this.groupBox4.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.numericUpDown2).EndInit();
		((System.ComponentModel.ISupportInitialize)this.numericUpDown1).EndInit();
		this.PageDeadTime.ResumeLayout(false);
		this.PageDeadTime.PerformLayout();
		this.tabHexapole.ResumeLayout(false);
		this.gbHexapole.ResumeLayout(false);
		this.gbHexapole.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvHexapole).EndInit();
		this.tableLayoutPanel3.ResumeLayout(false);
		this.tabControl3.ResumeLayout(false);
		this.tabPage7.ResumeLayout(false);
		this.groupBox12.ResumeLayout(false);
		this.groupBox13.ResumeLayout(false);
		this.groupBox13.PerformLayout();
		this.groupBox14.ResumeLayout(false);
		this.groupBox14.PerformLayout();
		this.toolStrip1.ResumeLayout(false);
		this.toolStrip1.PerformLayout();
		base.ResumeLayout(false);
	}
}
